// modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles
parcelRequire = (function (modules, cache, entry, globalName) {
  // Save the require from previous bundle to this closure if any
  var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
  var nodeRequire = typeof require === 'function' && require;

  function newRequire(name, jumped) {
    if (!cache[name]) {
      if (!modules[name]) {
        // if we cannot find the module within our internal map or
        // cache jump to the current global require ie. the last bundle
        // that was added to the page.
        var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
        if (!jumped && currentRequire) {
          return currentRequire(name, true);
        }

        // If there are other bundles on this page the require from the
        // previous one is saved to 'previousRequire'. Repeat this as
        // many times as there are bundles until the module is found or
        // we exhaust the require chain.
        if (previousRequire) {
          return previousRequire(name, true);
        }

        // Try the node require function if it exists.
        if (nodeRequire && typeof name === 'string') {
          return nodeRequire(name);
        }

        var err = new Error('Cannot find module \'' + name + '\'');
        err.code = 'MODULE_NOT_FOUND';
        throw err;
      }

      localRequire.resolve = resolve;
      localRequire.cache = {};

      var module = cache[name] = new newRequire.Module(name);

      modules[name][0].call(module.exports, localRequire, module, module.exports, this);
    }

    return cache[name].exports;

    function localRequire(x){
      return newRequire(localRequire.resolve(x));
    }

    function resolve(x){
      return modules[name][1][x] || x;
    }
  }

  function Module(moduleName) {
    this.id = moduleName;
    this.bundle = newRequire;
    this.exports = {};
  }

  newRequire.isParcelRequire = true;
  newRequire.Module = Module;
  newRequire.modules = modules;
  newRequire.cache = cache;
  newRequire.parent = previousRequire;
  newRequire.register = function (id, exports) {
    modules[id] = [function (require, module) {
      module.exports = exports;
    }, {}];
  };

  var error;
  for (var i = 0; i < entry.length; i++) {
    try {
      newRequire(entry[i]);
    } catch (e) {
      // Save first error but execute all entries
      if (!error) {
        error = e;
      }
    }
  }

  if (entry.length) {
    // Expose entry point to Node, AMD or browser globals
    // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
    var mainExports = newRequire(entry[entry.length - 1]);

    // CommonJS
    if (typeof exports === "object" && typeof module !== "undefined") {
      module.exports = mainExports;

    // RequireJS
    } else if (typeof define === "function" && define.amd) {
     define(function () {
       return mainExports;
     });

    // <script>
    } else if (globalName) {
      this[globalName] = mainExports;
    }
  }

  // Override the current require with this new one
  parcelRequire = newRequire;

  if (error) {
    // throw error from earlier, _after updating parcelRequire_
    throw error;
  }

  return newRequire;
})({"../output/Browser.Runtime/foreign.js":[function(require,module,exports) {
"use strict";

exports.connect = function () {
  return browser.runtime.connect({
    name: name
  });
};

exports.postMessage = function (port) {
  return function (message) {
    return function () {
      port.postMessage(message);
    };
  };
};

exports.onConnectAddListener = function (fn) {
  return function () {
    return browser.runtime.onConnect.addListener(fn);
  };
};

exports.portOnDisconnect = function (port) {
  return function (fn) {
    return function () {
      return port.onDisconnect.addListener(fn);
    };
  };
};

exports.onMessageAddListener = function (port) {
  return function (fn) {
    return function () {
      return port.onMessage.addListener(fn);
    };
  };
};

exports.onMessageRemoveListener = function (port) {
  return function (fn) {
    return function () {
      return port.onMessage.removeListener(fn);
    };
  };
};

exports.portEquality = function (p1) {
  return function (p2) {
    return p1 === p2;
  };
};
},{}],"../output/Browser.Utils/foreign.js":[function(require,module,exports) {
"use stricts";

exports.mkListenerUnit = function (fn) {
  return function () {
    return function () {
      return fn();
    };
  };
};

exports.mkListenerOne = function (fn) {
  return function () {
    return function (one) {
      return fn(one)();
    };
  };
};

exports.mkListenerTwo = function (fn) {
  return function () {
    return function (one, two) {
      return fn(one)(two)();
    };
  };
};
},{}],"../output/Control.Apply/foreign.js":[function(require,module,exports) {
"use strict";

exports.arrayApply = function (fs) {
  return function (xs) {
    var l = fs.length;
    var k = xs.length;
    var result = new Array(l * k);
    var n = 0;

    for (var i = 0; i < l; i++) {
      var f = fs[i];

      for (var j = 0; j < k; j++) {
        result[n++] = f(xs[j]);
      }
    }

    return result;
  };
};
},{}],"../output/Control.Semigroupoid/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Semigroupoid = function Semigroupoid(compose) {
  this.compose = compose;
};

var semigroupoidFn = new Semigroupoid(function (f) {
  return function (g) {
    return function (x) {
      return f(g(x));
    };
  };
});

var compose = function compose(dict) {
  return dict.compose;
};

var composeFlipped = function composeFlipped(dictSemigroupoid) {
  return function (f) {
    return function (g) {
      return compose(dictSemigroupoid)(g)(f);
    };
  };
};

module.exports = {
  compose: compose,
  Semigroupoid: Semigroupoid,
  composeFlipped: composeFlipped,
  semigroupoidFn: semigroupoidFn
};
},{}],"../output/Control.Category/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Category = function Category(Semigroupoid0, identity) {
  this.Semigroupoid0 = Semigroupoid0;
  this.identity = identity;
};

var identity = function identity(dict) {
  return dict.identity;
};

var categoryFn = new Category(function () {
  return Control_Semigroupoid.semigroupoidFn;
}, function (x) {
  return x;
});
module.exports = {
  Category: Category,
  identity: identity,
  categoryFn: categoryFn
};
},{"../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js"}],"../output/Data.Boolean/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var otherwise = true;
module.exports = {
  otherwise: otherwise
};
},{}],"../output/Data.Function/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Boolean = require("../Data.Boolean/index.js");

var on = function on(f) {
  return function (g) {
    return function (x) {
      return function (y) {
        return f(g(x))(g(y));
      };
    };
  };
};

var flip = function flip(f) {
  return function (b) {
    return function (a) {
      return f(a)(b);
    };
  };
};

var $$const = function $$const(a) {
  return function (v) {
    return a;
  };
};

var applyN = function applyN(f) {
  var go = function go($copy_n) {
    return function ($copy_acc) {
      var $tco_var_n = $copy_n;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(n, acc) {
        if (n <= 0) {
          $tco_done = true;
          return acc;
        }

        ;

        if (Data_Boolean.otherwise) {
          $tco_var_n = n - 1 | 0;
          $copy_acc = f(acc);
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.Function (line 94, column 3 - line 96, column 37): " + [n.constructor.name, acc.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_n, $copy_acc);
      }

      ;
      return $tco_result;
    };
  };

  return go;
};

var applyFlipped = function applyFlipped(x) {
  return function (f) {
    return f(x);
  };
};

var apply = function apply(f) {
  return function (x) {
    return f(x);
  };
};

module.exports = {
  flip: flip,
  "const": $$const,
  apply: apply,
  applyFlipped: applyFlipped,
  applyN: applyN,
  on: on
};
},{"../Data.Boolean/index.js":"../output/Data.Boolean/index.js"}],"../output/Data.Functor/foreign.js":[function(require,module,exports) {
"use strict";

exports.arrayMap = function (f) {
  return function (arr) {
    var l = arr.length;
    var result = new Array(l);

    for (var i = 0; i < l; i++) {
      result[i] = f(arr[i]);
    }

    return result;
  };
};
},{}],"../output/Data.Unit/foreign.js":[function(require,module,exports) {
"use strict";

exports.unit = {};
},{}],"../output/Data.Show/foreign.js":[function(require,module,exports) {
"use strict";

exports.showIntImpl = function (n) {
  return n.toString();
};

exports.showNumberImpl = function (n) {
  var str = n.toString();
  return isNaN(str + ".0") ? str : str + ".0";
};

exports.showCharImpl = function (c) {
  var code = c.charCodeAt(0);

  if (code < 0x20 || code === 0x7F) {
    switch (c) {
      case "\x07":
        return "'\\a'";

      case "\b":
        return "'\\b'";

      case "\f":
        return "'\\f'";

      case "\n":
        return "'\\n'";

      case "\r":
        return "'\\r'";

      case "\t":
        return "'\\t'";

      case "\v":
        return "'\\v'";
    }

    return "'\\" + code.toString(10) + "'";
  }

  return c === "'" || c === "\\" ? "'\\" + c + "'" : "'" + c + "'";
};

exports.showStringImpl = function (s) {
  var l = s.length;
  return "\"" + s.replace(/[\0-\x1F\x7F"\\]/g, // eslint-disable-line no-control-regex
  function (c, i) {
    switch (c) {
      case "\"":
      case "\\":
        return "\\" + c;

      case "\x07":
        return "\\a";

      case "\b":
        return "\\b";

      case "\f":
        return "\\f";

      case "\n":
        return "\\n";

      case "\r":
        return "\\r";

      case "\t":
        return "\\t";

      case "\v":
        return "\\v";
    }

    var k = i + 1;
    var empty = k < l && s[k] >= "0" && s[k] <= "9" ? "\\&" : "";
    return "\\" + c.charCodeAt(0).toString(10) + empty;
  }) + "\"";
};

exports.showArrayImpl = function (f) {
  return function (xs) {
    var ss = [];

    for (var i = 0, l = xs.length; i < l; i++) {
      ss[i] = f(xs[i]);
    }

    return "[" + ss.join(",") + "]";
  };
};

exports.cons = function (head) {
  return function (tail) {
    return [head].concat(tail);
  };
};

exports.join = function (separator) {
  return function (xs) {
    return xs.join(separator);
  };
};
},{}],"../output/Data.Symbol/foreign.js":[function(require,module,exports) {
"use strict"; // module Data.Symbol

exports.unsafeCoerce = function (arg) {
  return arg;
};
},{}],"../output/Data.Symbol/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var SProxy = function () {
  function SProxy() {}

  ;
  SProxy.value = new SProxy();
  return SProxy;
}();

var IsSymbol = function IsSymbol(reflectSymbol) {
  this.reflectSymbol = reflectSymbol;
};

var reifySymbol = function reifySymbol(s) {
  return function (f) {
    return $foreign.unsafeCoerce(function (dictIsSymbol) {
      return f(dictIsSymbol);
    })({
      reflectSymbol: function reflectSymbol(v) {
        return s;
      }
    })(SProxy.value);
  };
};

var reflectSymbol = function reflectSymbol(dict) {
  return dict.reflectSymbol;
};

module.exports = {
  IsSymbol: IsSymbol,
  reflectSymbol: reflectSymbol,
  reifySymbol: reifySymbol,
  SProxy: SProxy
};
},{"./foreign.js":"../output/Data.Symbol/foreign.js"}],"../output/Record.Unsafe/foreign.js":[function(require,module,exports) {
"use strict";

exports.unsafeHas = function (label) {
  return function (rec) {
    return {}.hasOwnProperty.call(rec, label);
  };
};

exports.unsafeGet = function (label) {
  return function (rec) {
    return rec[label];
  };
};

exports.unsafeSet = function (label) {
  return function (value) {
    return function (rec) {
      var copy = {};

      for (var key in rec) {
        if ({}.hasOwnProperty.call(rec, key)) {
          copy[key] = rec[key];
        }
      }

      copy[label] = value;
      return copy;
    };
  };
};

exports.unsafeDelete = function (label) {
  return function (rec) {
    var copy = {};

    for (var key in rec) {
      if (key !== label && {}.hasOwnProperty.call(rec, key)) {
        copy[key] = rec[key];
      }
    }

    return copy;
  };
};
},{}],"../output/Record.Unsafe/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

module.exports = {
  unsafeHas: $foreign.unsafeHas,
  unsafeGet: $foreign.unsafeGet,
  unsafeSet: $foreign.unsafeSet,
  unsafeDelete: $foreign.unsafeDelete
};
},{"./foreign.js":"../output/Record.Unsafe/foreign.js"}],"../output/Type.Data.RowList/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var RLProxy = function () {
  function RLProxy() {}

  ;
  RLProxy.value = new RLProxy();
  return RLProxy;
}();

module.exports = {
  RLProxy: RLProxy
};
},{}],"../output/Data.Show/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var ShowRecordFields = function ShowRecordFields(showRecordFields) {
  this.showRecordFields = showRecordFields;
};

var Show = function Show(show) {
  this.show = show;
};

var showString = new Show($foreign.showStringImpl);
var showRecordFieldsNil = new ShowRecordFields(function (v) {
  return function (v1) {
    return [];
  };
});

var showRecordFields = function showRecordFields(dict) {
  return dict.showRecordFields;
};

var showRecord = function showRecord(dictRowToList) {
  return function (dictShowRecordFields) {
    return new Show(function (record) {
      var v = showRecordFields(dictShowRecordFields)(Type_Data_RowList.RLProxy.value)(record);

      if (v.length === 0) {
        return "{}";
      }

      ;
      return $foreign.join(" ")(["{", $foreign.join(", ")(v), "}"]);
    });
  };
};

var showNumber = new Show($foreign.showNumberImpl);
var showInt = new Show($foreign.showIntImpl);
var showChar = new Show($foreign.showCharImpl);
var showBoolean = new Show(function (v) {
  if (v) {
    return "true";
  }

  ;

  if (!v) {
    return "false";
  }

  ;
  throw new Error("Failed pattern match at Data.Show (line 20, column 1 - line 22, column 23): " + [v.constructor.name]);
});

var show = function show(dict) {
  return dict.show;
};

var showArray = function showArray(dictShow) {
  return new Show($foreign.showArrayImpl(show(dictShow)));
};

var showRecordFieldsCons = function showRecordFieldsCons(dictIsSymbol) {
  return function (dictShowRecordFields) {
    return function (dictShow) {
      return new ShowRecordFields(function (v) {
        return function (record) {
          var tail = showRecordFields(dictShowRecordFields)(Type_Data_RowList.RLProxy.value)(record);
          var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
          var focus = Record_Unsafe.unsafeGet(key)(record);
          return $foreign.cons($foreign.join(": ")([key, show(dictShow)(focus)]))(tail);
        };
      });
    };
  };
};

module.exports = {
  Show: Show,
  show: show,
  ShowRecordFields: ShowRecordFields,
  showRecordFields: showRecordFields,
  showBoolean: showBoolean,
  showInt: showInt,
  showNumber: showNumber,
  showChar: showChar,
  showString: showString,
  showArray: showArray,
  showRecord: showRecord,
  showRecordFieldsNil: showRecordFieldsNil,
  showRecordFieldsCons: showRecordFieldsCons
};
},{"./foreign.js":"../output/Data.Show/foreign.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Data.Unit/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Show = require("../Data.Show/index.js");

var showUnit = new Data_Show.Show(function (v) {
  return "unit";
});
module.exports = {
  showUnit: showUnit,
  unit: $foreign.unit
};
},{"./foreign.js":"../output/Data.Unit/foreign.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Functor/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Functor = function Functor(map) {
  this.map = map;
};

var map = function map(dict) {
  return dict.map;
};

var mapFlipped = function mapFlipped(dictFunctor) {
  return function (fa) {
    return function (f) {
      return map(dictFunctor)(f)(fa);
    };
  };
};

var $$void = function $$void(dictFunctor) {
  return map(dictFunctor)(Data_Function["const"](Data_Unit.unit));
};

var voidLeft = function voidLeft(dictFunctor) {
  return function (f) {
    return function (x) {
      return map(dictFunctor)(Data_Function["const"](x))(f);
    };
  };
};

var voidRight = function voidRight(dictFunctor) {
  return function (x) {
    return map(dictFunctor)(Data_Function["const"](x));
  };
};

var functorFn = new Functor(Control_Semigroupoid.compose(Control_Semigroupoid.semigroupoidFn));
var functorArray = new Functor($foreign.arrayMap);

var flap = function flap(dictFunctor) {
  return function (ff) {
    return function (x) {
      return map(dictFunctor)(function (f) {
        return f(x);
      })(ff);
    };
  };
};

module.exports = {
  Functor: Functor,
  map: map,
  mapFlipped: mapFlipped,
  "void": $$void,
  voidRight: voidRight,
  voidLeft: voidLeft,
  flap: flap,
  functorFn: functorFn,
  functorArray: functorArray
};
},{"./foreign.js":"../output/Data.Functor/foreign.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Control.Apply/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Apply = function Apply(Functor0, apply) {
  this.Functor0 = Functor0;
  this.apply = apply;
};

var applyFn = new Apply(function () {
  return Data_Functor.functorFn;
}, function (f) {
  return function (g) {
    return function (x) {
      return f(x)(g(x));
    };
  };
});
var applyArray = new Apply(function () {
  return Data_Functor.functorArray;
}, $foreign.arrayApply);

var apply = function apply(dict) {
  return dict.apply;
};

var applyFirst = function applyFirst(dictApply) {
  return function (a) {
    return function (b) {
      return apply(dictApply)(Data_Functor.map(dictApply.Functor0())(Data_Function["const"])(a))(b);
    };
  };
};

var applySecond = function applySecond(dictApply) {
  return function (a) {
    return function (b) {
      return apply(dictApply)(Data_Functor.map(dictApply.Functor0())(Data_Function["const"](Control_Category.identity(Control_Category.categoryFn)))(a))(b);
    };
  };
};

var lift2 = function lift2(dictApply) {
  return function (f) {
    return function (a) {
      return function (b) {
        return apply(dictApply)(Data_Functor.map(dictApply.Functor0())(f)(a))(b);
      };
    };
  };
};

var lift3 = function lift3(dictApply) {
  return function (f) {
    return function (a) {
      return function (b) {
        return function (c) {
          return apply(dictApply)(apply(dictApply)(Data_Functor.map(dictApply.Functor0())(f)(a))(b))(c);
        };
      };
    };
  };
};

var lift4 = function lift4(dictApply) {
  return function (f) {
    return function (a) {
      return function (b) {
        return function (c) {
          return function (d) {
            return apply(dictApply)(apply(dictApply)(apply(dictApply)(Data_Functor.map(dictApply.Functor0())(f)(a))(b))(c))(d);
          };
        };
      };
    };
  };
};

var lift5 = function lift5(dictApply) {
  return function (f) {
    return function (a) {
      return function (b) {
        return function (c) {
          return function (d) {
            return function (e) {
              return apply(dictApply)(apply(dictApply)(apply(dictApply)(apply(dictApply)(Data_Functor.map(dictApply.Functor0())(f)(a))(b))(c))(d))(e);
            };
          };
        };
      };
    };
  };
};

module.exports = {
  Apply: Apply,
  apply: apply,
  applyFirst: applyFirst,
  applySecond: applySecond,
  lift2: lift2,
  lift3: lift3,
  lift4: lift4,
  lift5: lift5,
  applyFn: applyFn,
  applyArray: applyArray
};
},{"./foreign.js":"../output/Control.Apply/foreign.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js"}],"../output/Control.Applicative/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Apply = require("../Control.Apply/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Applicative = function Applicative(Apply0, pure) {
  this.Apply0 = Apply0;
  this.pure = pure;
};

var pure = function pure(dict) {
  return dict.pure;
};

var unless = function unless(dictApplicative) {
  return function (v) {
    return function (v1) {
      if (!v) {
        return v1;
      }

      ;

      if (v) {
        return pure(dictApplicative)(Data_Unit.unit);
      }

      ;
      throw new Error("Failed pattern match at Control.Applicative (line 62, column 1 - line 62, column 65): " + [v.constructor.name, v1.constructor.name]);
    };
  };
};

var when = function when(dictApplicative) {
  return function (v) {
    return function (v1) {
      if (v) {
        return v1;
      }

      ;

      if (!v) {
        return pure(dictApplicative)(Data_Unit.unit);
      }

      ;
      throw new Error("Failed pattern match at Control.Applicative (line 57, column 1 - line 57, column 63): " + [v.constructor.name, v1.constructor.name]);
    };
  };
};

var liftA1 = function liftA1(dictApplicative) {
  return function (f) {
    return function (a) {
      return Control_Apply.apply(dictApplicative.Apply0())(pure(dictApplicative)(f))(a);
    };
  };
};

var applicativeFn = new Applicative(function () {
  return Control_Apply.applyFn;
}, function (x) {
  return function (v) {
    return x;
  };
});
var applicativeArray = new Applicative(function () {
  return Control_Apply.applyArray;
}, function (x) {
  return [x];
});
module.exports = {
  Applicative: Applicative,
  pure: pure,
  liftA1: liftA1,
  unless: unless,
  when: when,
  applicativeFn: applicativeFn,
  applicativeArray: applicativeArray
};
},{"../Control.Apply/index.js":"../output/Control.Apply/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Semigroup/foreign.js":[function(require,module,exports) {
"use strict";

exports.concatString = function (s1) {
  return function (s2) {
    return s1 + s2;
  };
};

exports.concatArray = function (xs) {
  return function (ys) {
    if (xs.length === 0) return ys;
    if (ys.length === 0) return xs;
    return xs.concat(ys);
  };
};
},{}],"../output/Data.Void/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Show = require("../Data.Show/index.js");

var Void = function Void(x) {
  return x;
};

var absurd = function absurd(a) {
  var spin = function spin($copy_v) {
    var $tco_result;

    function $tco_loop(v) {
      $copy_v = v;
      return;
    }

    ;

    while (!false) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  return spin(a);
};

var showVoid = new Data_Show.Show(absurd);
module.exports = {
  absurd: absurd,
  showVoid: showVoid
};
},{"../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Semigroup/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Data_Void = require("../Data.Void/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var SemigroupRecord = function SemigroupRecord(appendRecord) {
  this.appendRecord = appendRecord;
};

var Semigroup = function Semigroup(append) {
  this.append = append;
};

var semigroupVoid = new Semigroup(function (v) {
  return Data_Void.absurd;
});
var semigroupUnit = new Semigroup(function (v) {
  return function (v1) {
    return Data_Unit.unit;
  };
});
var semigroupString = new Semigroup($foreign.concatString);
var semigroupRecordNil = new SemigroupRecord(function (v) {
  return function (v1) {
    return function (v2) {
      return {};
    };
  };
});
var semigroupArray = new Semigroup($foreign.concatArray);

var appendRecord = function appendRecord(dict) {
  return dict.appendRecord;
};

var semigroupRecord = function semigroupRecord(dictRowToList) {
  return function (dictSemigroupRecord) {
    return new Semigroup(appendRecord(dictSemigroupRecord)(Type_Data_RowList.RLProxy.value));
  };
};

var append = function append(dict) {
  return dict.append;
};

var semigroupFn = function semigroupFn(dictSemigroup) {
  return new Semigroup(function (f) {
    return function (g) {
      return function (x) {
        return append(dictSemigroup)(f(x))(g(x));
      };
    };
  });
};

var semigroupRecordCons = function semigroupRecordCons(dictIsSymbol) {
  return function (dictCons) {
    return function (dictSemigroupRecord) {
      return function (dictSemigroup) {
        return new SemigroupRecord(function (v) {
          return function (ra) {
            return function (rb) {
              var tail = appendRecord(dictSemigroupRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var insert = Record_Unsafe.unsafeSet(key);
              var get = Record_Unsafe.unsafeGet(key);
              return insert(append(dictSemigroup)(get(ra))(get(rb)))(tail);
            };
          };
        });
      };
    };
  };
};

module.exports = {
  Semigroup: Semigroup,
  append: append,
  SemigroupRecord: SemigroupRecord,
  appendRecord: appendRecord,
  semigroupString: semigroupString,
  semigroupUnit: semigroupUnit,
  semigroupVoid: semigroupVoid,
  semigroupFn: semigroupFn,
  semigroupArray: semigroupArray,
  semigroupRecord: semigroupRecord,
  semigroupRecordNil: semigroupRecordNil,
  semigroupRecordCons: semigroupRecordCons
};
},{"./foreign.js":"../output/Data.Semigroup/foreign.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Data.Void/index.js":"../output/Data.Void/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Control.Alt/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Functor = require("../Data.Functor/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Alt = function Alt(Functor0, alt) {
  this.Functor0 = Functor0;
  this.alt = alt;
};

var altArray = new Alt(function () {
  return Data_Functor.functorArray;
}, Data_Semigroup.append(Data_Semigroup.semigroupArray));

var alt = function alt(dict) {
  return dict.alt;
};

module.exports = {
  Alt: Alt,
  alt: alt,
  altArray: altArray
};
},{"../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js"}],"../output/Control.Plus/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Plus = function Plus(Alt0, empty) {
  this.Alt0 = Alt0;
  this.empty = empty;
};

var plusArray = new Plus(function () {
  return Control_Alt.altArray;
}, []);

var empty = function empty(dict) {
  return dict.empty;
};

module.exports = {
  Plus: Plus,
  empty: empty,
  plusArray: plusArray
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js"}],"../output/Control.Alternative/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Alternative = function Alternative(Applicative0, Plus1) {
  this.Applicative0 = Applicative0;
  this.Plus1 = Plus1;
};

var alternativeArray = new Alternative(function () {
  return Control_Applicative.applicativeArray;
}, function () {
  return Control_Plus.plusArray;
});
module.exports = {
  Alternative: Alternative,
  alternativeArray: alternativeArray
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js"}],"../output/Control.Bind/foreign.js":[function(require,module,exports) {
"use strict";

exports.arrayBind = function (arr) {
  return function (f) {
    var result = [];

    for (var i = 0, l = arr.length; i < l; i++) {
      Array.prototype.push.apply(result, f(arr[i]));
    }

    return result;
  };
};
},{}],"../output/Control.Bind/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Function = require("../Data.Function/index.js");

var Discard = function Discard(discard) {
  this.discard = discard;
};

var Bind = function Bind(Apply0, bind) {
  this.Apply0 = Apply0;
  this.bind = bind;
};

var discard = function discard(dict) {
  return dict.discard;
};

var bindFn = new Bind(function () {
  return Control_Apply.applyFn;
}, function (m) {
  return function (f) {
    return function (x) {
      return f(m(x))(x);
    };
  };
});
var bindArray = new Bind(function () {
  return Control_Apply.applyArray;
}, $foreign.arrayBind);

var bind = function bind(dict) {
  return dict.bind;
};

var bindFlipped = function bindFlipped(dictBind) {
  return Data_Function.flip(bind(dictBind));
};

var composeKleisliFlipped = function composeKleisliFlipped(dictBind) {
  return function (f) {
    return function (g) {
      return function (a) {
        return bindFlipped(dictBind)(f)(g(a));
      };
    };
  };
};

var composeKleisli = function composeKleisli(dictBind) {
  return function (f) {
    return function (g) {
      return function (a) {
        return bind(dictBind)(f(a))(g);
      };
    };
  };
};

var discardUnit = new Discard(function (dictBind) {
  return bind(dictBind);
});

var ifM = function ifM(dictBind) {
  return function (cond) {
    return function (t) {
      return function (f) {
        return bind(dictBind)(cond)(function (cond$prime) {
          if (cond$prime) {
            return t;
          }

          ;
          return f;
        });
      };
    };
  };
};

var join = function join(dictBind) {
  return function (m) {
    return bind(dictBind)(m)(Control_Category.identity(Control_Category.categoryFn));
  };
};

module.exports = {
  Bind: Bind,
  bind: bind,
  bindFlipped: bindFlipped,
  Discard: Discard,
  discard: discard,
  join: join,
  composeKleisli: composeKleisli,
  composeKleisliFlipped: composeKleisliFlipped,
  ifM: ifM,
  bindFn: bindFn,
  bindArray: bindArray,
  discardUnit: discardUnit
};
},{"./foreign.js":"../output/Control.Bind/foreign.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Function/index.js":"../output/Data.Function/index.js"}],"../output/Control.Monad/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Monad = function Monad(Applicative0, Bind1) {
  this.Applicative0 = Applicative0;
  this.Bind1 = Bind1;
};

var whenM = function whenM(dictMonad) {
  return function (mb) {
    return function (m) {
      return Control_Bind.bind(dictMonad.Bind1())(mb)(function (b) {
        return Control_Applicative.when(dictMonad.Applicative0())(b)(m);
      });
    };
  };
};

var unlessM = function unlessM(dictMonad) {
  return function (mb) {
    return function (m) {
      return Control_Bind.bind(dictMonad.Bind1())(mb)(function (b) {
        return Control_Applicative.unless(dictMonad.Applicative0())(b)(m);
      });
    };
  };
};

var monadFn = new Monad(function () {
  return Control_Applicative.applicativeFn;
}, function () {
  return Control_Bind.bindFn;
});
var monadArray = new Monad(function () {
  return Control_Applicative.applicativeArray;
}, function () {
  return Control_Bind.bindArray;
});

var liftM1 = function liftM1(dictMonad) {
  return function (f) {
    return function (a) {
      return Control_Bind.bind(dictMonad.Bind1())(a)(function (a$prime) {
        return Control_Applicative.pure(dictMonad.Applicative0())(f(a$prime));
      });
    };
  };
};

var ap = function ap(dictMonad) {
  return function (f) {
    return function (a) {
      return Control_Bind.bind(dictMonad.Bind1())(f)(function (f$prime) {
        return Control_Bind.bind(dictMonad.Bind1())(a)(function (a$prime) {
          return Control_Applicative.pure(dictMonad.Applicative0())(f$prime(a$prime));
        });
      });
    };
  };
};

module.exports = {
  Monad: Monad,
  liftM1: liftM1,
  ap: ap,
  whenM: whenM,
  unlessM: unlessM,
  monadFn: monadFn,
  monadArray: monadArray
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js"}],"../output/Control.Monad.Cont.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var MonadCont = function MonadCont(Monad0, callCC) {
  this.Monad0 = Monad0;
  this.callCC = callCC;
};

var callCC = function callCC(dict) {
  return dict.callCC;
};

module.exports = {
  MonadCont: MonadCont,
  callCC: callCC
};
},{}],"../output/Control.Extend/foreign.js":[function(require,module,exports) {
"use strict";

exports.arrayExtend = function (f) {
  return function (xs) {
    return xs.map(function (_, i, xs) {
      return f(xs.slice(i));
    });
  };
};
},{}],"../output/Control.Extend/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Extend = function Extend(Functor0, extend) {
  this.Functor0 = Functor0;
  this.extend = extend;
};

var extendFn = function extendFn(dictSemigroup) {
  return new Extend(function () {
    return Data_Functor.functorFn;
  }, function (f) {
    return function (g) {
      return function (w) {
        return f(function (w$prime) {
          return g(Data_Semigroup.append(dictSemigroup)(w)(w$prime));
        });
      };
    };
  });
};

var extendArray = new Extend(function () {
  return Data_Functor.functorArray;
}, $foreign.arrayExtend);

var extend = function extend(dict) {
  return dict.extend;
};

var extendFlipped = function extendFlipped(dictExtend) {
  return function (w) {
    return function (f) {
      return extend(dictExtend)(f)(w);
    };
  };
};

var duplicate = function duplicate(dictExtend) {
  return extend(dictExtend)(Control_Category.identity(Control_Category.categoryFn));
};

var composeCoKleisliFlipped = function composeCoKleisliFlipped(dictExtend) {
  return function (f) {
    return function (g) {
      return function (w) {
        return f(extend(dictExtend)(g)(w));
      };
    };
  };
};

var composeCoKleisli = function composeCoKleisli(dictExtend) {
  return function (f) {
    return function (g) {
      return function (w) {
        return g(extend(dictExtend)(f)(w));
      };
    };
  };
};

module.exports = {
  Extend: Extend,
  extend: extend,
  extendFlipped: extendFlipped,
  composeCoKleisli: composeCoKleisli,
  composeCoKleisliFlipped: composeCoKleisliFlipped,
  duplicate: duplicate,
  extendFn: extendFn,
  extendArray: extendArray
};
},{"./foreign.js":"../output/Control.Extend/foreign.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js"}],"../output/Data.Foldable/foreign.js":[function(require,module,exports) {
"use strict";

exports.foldrArray = function (f) {
  return function (init) {
    return function (xs) {
      var acc = init;
      var len = xs.length;

      for (var i = len - 1; i >= 0; i--) {
        acc = f(xs[i])(acc);
      }

      return acc;
    };
  };
};

exports.foldlArray = function (f) {
  return function (init) {
    return function (xs) {
      var acc = init;
      var len = xs.length;

      for (var i = 0; i < len; i++) {
        acc = f(acc)(xs[i]);
      }

      return acc;
    };
  };
};
},{}],"../output/Data.Eq/foreign.js":[function(require,module,exports) {
"use strict";

var refEq = function refEq(r1) {
  return function (r2) {
    return r1 === r2;
  };
};

exports.eqBooleanImpl = refEq;
exports.eqIntImpl = refEq;
exports.eqNumberImpl = refEq;
exports.eqCharImpl = refEq;
exports.eqStringImpl = refEq;

exports.eqArrayImpl = function (f) {
  return function (xs) {
    return function (ys) {
      if (xs === ys) return true;
      if (xs.length !== ys.length) return false;

      for (var i = 0; i < xs.length; i++) {
        if (!f(xs[i])(ys[i])) return false;
      }

      return true;
    };
  };
};
},{}],"../output/Data.Eq/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var EqRecord = function EqRecord(eqRecord) {
  this.eqRecord = eqRecord;
};

var Eq1 = function Eq1(eq1) {
  this.eq1 = eq1;
};

var Eq = function Eq(eq) {
  this.eq = eq;
};

var eqVoid = new Eq(function (v) {
  return function (v1) {
    return true;
  };
});
var eqUnit = new Eq(function (v) {
  return function (v1) {
    return true;
  };
});
var eqString = new Eq($foreign.eqStringImpl);
var eqRowNil = new EqRecord(function (v) {
  return function (v1) {
    return function (v2) {
      return true;
    };
  };
});

var eqRecord = function eqRecord(dict) {
  return dict.eqRecord;
};

var eqRec = function eqRec(dictRowToList) {
  return function (dictEqRecord) {
    return new Eq(eqRecord(dictEqRecord)(Type_Data_RowList.RLProxy.value));
  };
};

var eqNumber = new Eq($foreign.eqNumberImpl);
var eqInt = new Eq($foreign.eqIntImpl);
var eqChar = new Eq($foreign.eqCharImpl);
var eqBoolean = new Eq($foreign.eqBooleanImpl);

var eq1 = function eq1(dict) {
  return dict.eq1;
};

var eq = function eq(dict) {
  return dict.eq;
};

var eqArray = function eqArray(dictEq) {
  return new Eq($foreign.eqArrayImpl(eq(dictEq)));
};

var eq1Array = new Eq1(function (dictEq) {
  return eq(eqArray(dictEq));
});

var eqRowCons = function eqRowCons(dictEqRecord) {
  return function (dictCons) {
    return function (dictIsSymbol) {
      return function (dictEq) {
        return new EqRecord(function (v) {
          return function (ra) {
            return function (rb) {
              var tail = eqRecord(dictEqRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var get = Record_Unsafe.unsafeGet(key);
              return eq(dictEq)(get(ra))(get(rb)) && tail;
            };
          };
        });
      };
    };
  };
};

var notEq = function notEq(dictEq) {
  return function (x) {
    return function (y) {
      return eq(eqBoolean)(eq(dictEq)(x)(y))(false);
    };
  };
};

var notEq1 = function notEq1(dictEq1) {
  return function (dictEq) {
    return function (x) {
      return function (y) {
        return eq(eqBoolean)(eq1(dictEq1)(dictEq)(x)(y))(false);
      };
    };
  };
};

module.exports = {
  Eq: Eq,
  eq: eq,
  notEq: notEq,
  Eq1: Eq1,
  eq1: eq1,
  notEq1: notEq1,
  EqRecord: EqRecord,
  eqRecord: eqRecord,
  eqBoolean: eqBoolean,
  eqInt: eqInt,
  eqNumber: eqNumber,
  eqChar: eqChar,
  eqString: eqString,
  eqUnit: eqUnit,
  eqVoid: eqVoid,
  eqArray: eqArray,
  eqRec: eqRec,
  eq1Array: eq1Array,
  eqRowNil: eqRowNil,
  eqRowCons: eqRowCons
};
},{"./foreign.js":"../output/Data.Eq/foreign.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Data.HeytingAlgebra/foreign.js":[function(require,module,exports) {
"use strict";

exports.boolConj = function (b1) {
  return function (b2) {
    return b1 && b2;
  };
};

exports.boolDisj = function (b1) {
  return function (b2) {
    return b1 || b2;
  };
};

exports.boolNot = function (b) {
  return !b;
};
},{}],"../output/Type.Data.Row/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var RProxy = function () {
  function RProxy() {}

  ;
  RProxy.value = new RProxy();
  return RProxy;
}();

module.exports = {
  RProxy: RProxy
};
},{}],"../output/Data.HeytingAlgebra/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_Row = require("../Type.Data.Row/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var HeytingAlgebraRecord = function HeytingAlgebraRecord(conjRecord, disjRecord, ffRecord, impliesRecord, notRecord, ttRecord) {
  this.conjRecord = conjRecord;
  this.disjRecord = disjRecord;
  this.ffRecord = ffRecord;
  this.impliesRecord = impliesRecord;
  this.notRecord = notRecord;
  this.ttRecord = ttRecord;
};

var HeytingAlgebra = function HeytingAlgebra(conj, disj, ff, implies, not, tt) {
  this.conj = conj;
  this.disj = disj;
  this.ff = ff;
  this.implies = implies;
  this.not = not;
  this.tt = tt;
};

var ttRecord = function ttRecord(dict) {
  return dict.ttRecord;
};

var tt = function tt(dict) {
  return dict.tt;
};

var notRecord = function notRecord(dict) {
  return dict.notRecord;
};

var not = function not(dict) {
  return dict.not;
};

var impliesRecord = function impliesRecord(dict) {
  return dict.impliesRecord;
};

var implies = function implies(dict) {
  return dict.implies;
};

var heytingAlgebraUnit = new HeytingAlgebra(function (v) {
  return function (v1) {
    return Data_Unit.unit;
  };
}, function (v) {
  return function (v1) {
    return Data_Unit.unit;
  };
}, Data_Unit.unit, function (v) {
  return function (v1) {
    return Data_Unit.unit;
  };
}, function (v) {
  return Data_Unit.unit;
}, Data_Unit.unit);
var heytingAlgebraRecordNil = new HeytingAlgebraRecord(function (v) {
  return function (v1) {
    return function (v2) {
      return {};
    };
  };
}, function (v) {
  return function (v1) {
    return function (v2) {
      return {};
    };
  };
}, function (v) {
  return function (v1) {
    return {};
  };
}, function (v) {
  return function (v1) {
    return function (v2) {
      return {};
    };
  };
}, function (v) {
  return function (v1) {
    return {};
  };
}, function (v) {
  return function (v1) {
    return {};
  };
});

var ffRecord = function ffRecord(dict) {
  return dict.ffRecord;
};

var ff = function ff(dict) {
  return dict.ff;
};

var disjRecord = function disjRecord(dict) {
  return dict.disjRecord;
};

var disj = function disj(dict) {
  return dict.disj;
};

var heytingAlgebraBoolean = new HeytingAlgebra($foreign.boolConj, $foreign.boolDisj, false, function (a) {
  return function (b) {
    return disj(heytingAlgebraBoolean)(not(heytingAlgebraBoolean)(a))(b);
  };
}, $foreign.boolNot, true);

var conjRecord = function conjRecord(dict) {
  return dict.conjRecord;
};

var heytingAlgebraRecord = function heytingAlgebraRecord(dictRowToList) {
  return function (dictHeytingAlgebraRecord) {
    return new HeytingAlgebra(conjRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value), disjRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value), ffRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(Type_Data_Row.RProxy.value), impliesRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value), notRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value), ttRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(Type_Data_Row.RProxy.value));
  };
};

var conj = function conj(dict) {
  return dict.conj;
};

var heytingAlgebraFunction = function heytingAlgebraFunction(dictHeytingAlgebra) {
  return new HeytingAlgebra(function (f) {
    return function (g) {
      return function (a) {
        return conj(dictHeytingAlgebra)(f(a))(g(a));
      };
    };
  }, function (f) {
    return function (g) {
      return function (a) {
        return disj(dictHeytingAlgebra)(f(a))(g(a));
      };
    };
  }, function (v) {
    return ff(dictHeytingAlgebra);
  }, function (f) {
    return function (g) {
      return function (a) {
        return implies(dictHeytingAlgebra)(f(a))(g(a));
      };
    };
  }, function (f) {
    return function (a) {
      return not(dictHeytingAlgebra)(f(a));
    };
  }, function (v) {
    return tt(dictHeytingAlgebra);
  });
};

var heytingAlgebraRecordCons = function heytingAlgebraRecordCons(dictIsSymbol) {
  return function (dictCons) {
    return function (dictHeytingAlgebraRecord) {
      return function (dictHeytingAlgebra) {
        return new HeytingAlgebraRecord(function (v) {
          return function (ra) {
            return function (rb) {
              var tail = conjRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var insert = Record_Unsafe.unsafeSet(key);
              var get = Record_Unsafe.unsafeGet(key);
              return insert(conj(dictHeytingAlgebra)(get(ra))(get(rb)))(tail);
            };
          };
        }, function (v) {
          return function (ra) {
            return function (rb) {
              var tail = disjRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var insert = Record_Unsafe.unsafeSet(key);
              var get = Record_Unsafe.unsafeGet(key);
              return insert(disj(dictHeytingAlgebra)(get(ra))(get(rb)))(tail);
            };
          };
        }, function (v) {
          return function (row) {
            var tail = ffRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(row);
            var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
            var insert = Record_Unsafe.unsafeSet(key);
            return insert(ff(dictHeytingAlgebra))(tail);
          };
        }, function (v) {
          return function (ra) {
            return function (rb) {
              var tail = impliesRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var insert = Record_Unsafe.unsafeSet(key);
              var get = Record_Unsafe.unsafeGet(key);
              return insert(implies(dictHeytingAlgebra)(get(ra))(get(rb)))(tail);
            };
          };
        }, function (v) {
          return function (row) {
            var tail = notRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(row);
            var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
            var insert = Record_Unsafe.unsafeSet(key);
            var get = Record_Unsafe.unsafeGet(key);
            return insert(not(dictHeytingAlgebra)(get(row)))(tail);
          };
        }, function (v) {
          return function (row) {
            var tail = ttRecord(dictHeytingAlgebraRecord)(Type_Data_RowList.RLProxy.value)(row);
            var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
            var insert = Record_Unsafe.unsafeSet(key);
            return insert(tt(dictHeytingAlgebra))(tail);
          };
        });
      };
    };
  };
};

module.exports = {
  HeytingAlgebra: HeytingAlgebra,
  tt: tt,
  ff: ff,
  implies: implies,
  conj: conj,
  disj: disj,
  not: not,
  HeytingAlgebraRecord: HeytingAlgebraRecord,
  ffRecord: ffRecord,
  ttRecord: ttRecord,
  impliesRecord: impliesRecord,
  conjRecord: conjRecord,
  disjRecord: disjRecord,
  notRecord: notRecord,
  heytingAlgebraBoolean: heytingAlgebraBoolean,
  heytingAlgebraUnit: heytingAlgebraUnit,
  heytingAlgebraFunction: heytingAlgebraFunction,
  heytingAlgebraRecord: heytingAlgebraRecord,
  heytingAlgebraRecordNil: heytingAlgebraRecordNil,
  heytingAlgebraRecordCons: heytingAlgebraRecordCons
};
},{"./foreign.js":"../output/Data.HeytingAlgebra/foreign.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.Row/index.js":"../output/Type.Data.Row/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Control.MonadZero/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var MonadZero = function MonadZero(Alternative1, Monad0) {
  this.Alternative1 = Alternative1;
  this.Monad0 = Monad0;
};

var monadZeroArray = new MonadZero(function () {
  return Control_Alternative.alternativeArray;
}, function () {
  return Control_Monad.monadArray;
});

var guard = function guard(dictMonadZero) {
  return function (v) {
    if (v) {
      return Control_Applicative.pure(dictMonadZero.Alternative1().Applicative0())(Data_Unit.unit);
    }

    ;

    if (!v) {
      return Control_Plus.empty(dictMonadZero.Alternative1().Plus1());
    }

    ;
    throw new Error("Failed pattern match at Control.MonadZero (line 54, column 1 - line 54, column 52): " + [v.constructor.name]);
  };
};

module.exports = {
  MonadZero: MonadZero,
  guard: guard,
  monadZeroArray: monadZeroArray
};
},{"../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Bounded/foreign.js":[function(require,module,exports) {
"use strict";

exports.topInt = 2147483647;
exports.bottomInt = -2147483648;
exports.topChar = String.fromCharCode(65535);
exports.bottomChar = String.fromCharCode(0);
exports.topNumber = Number.POSITIVE_INFINITY;
exports.bottomNumber = Number.NEGATIVE_INFINITY;
},{}],"../output/Data.Ord/foreign.js":[function(require,module,exports) {
"use strict";

var unsafeCompareImpl = function unsafeCompareImpl(lt) {
  return function (eq) {
    return function (gt) {
      return function (x) {
        return function (y) {
          return x < y ? lt : x === y ? eq : gt;
        };
      };
    };
  };
};

exports.ordBooleanImpl = unsafeCompareImpl;
exports.ordIntImpl = unsafeCompareImpl;
exports.ordNumberImpl = unsafeCompareImpl;
exports.ordStringImpl = unsafeCompareImpl;
exports.ordCharImpl = unsafeCompareImpl;

exports.ordArrayImpl = function (f) {
  return function (xs) {
    return function (ys) {
      var i = 0;
      var xlen = xs.length;
      var ylen = ys.length;

      while (i < xlen && i < ylen) {
        var x = xs[i];
        var y = ys[i];
        var o = f(x)(y);

        if (o !== 0) {
          return o;
        }

        i++;
      }

      if (xlen === ylen) {
        return 0;
      } else if (xlen > ylen) {
        return -1;
      } else {
        return 1;
      }
    };
  };
};
},{}],"../output/Data.Ordering/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Eq = require("../Data.Eq/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var LT = function () {
  function LT() {}

  ;
  LT.value = new LT();
  return LT;
}();

var GT = function () {
  function GT() {}

  ;
  GT.value = new GT();
  return GT;
}();

var EQ = function () {
  function EQ() {}

  ;
  EQ.value = new EQ();
  return EQ;
}();

var showOrdering = new Data_Show.Show(function (v) {
  if (v instanceof LT) {
    return "LT";
  }

  ;

  if (v instanceof GT) {
    return "GT";
  }

  ;

  if (v instanceof EQ) {
    return "EQ";
  }

  ;
  throw new Error("Failed pattern match at Data.Ordering (line 26, column 1 - line 29, column 17): " + [v.constructor.name]);
});
var semigroupOrdering = new Data_Semigroup.Semigroup(function (v) {
  return function (v1) {
    if (v instanceof LT) {
      return LT.value;
    }

    ;

    if (v instanceof GT) {
      return GT.value;
    }

    ;

    if (v instanceof EQ) {
      return v1;
    }

    ;
    throw new Error("Failed pattern match at Data.Ordering (line 21, column 1 - line 24, column 18): " + [v.constructor.name, v1.constructor.name]);
  };
});

var invert = function invert(v) {
  if (v instanceof GT) {
    return LT.value;
  }

  ;

  if (v instanceof EQ) {
    return EQ.value;
  }

  ;

  if (v instanceof LT) {
    return GT.value;
  }

  ;
  throw new Error("Failed pattern match at Data.Ordering (line 33, column 1 - line 33, column 31): " + [v.constructor.name]);
};

var eqOrdering = new Data_Eq.Eq(function (v) {
  return function (v1) {
    if (v instanceof LT && v1 instanceof LT) {
      return true;
    }

    ;

    if (v instanceof GT && v1 instanceof GT) {
      return true;
    }

    ;

    if (v instanceof EQ && v1 instanceof EQ) {
      return true;
    }

    ;
    return false;
  };
});
module.exports = {
  LT: LT,
  GT: GT,
  EQ: EQ,
  invert: invert,
  eqOrdering: eqOrdering,
  semigroupOrdering: semigroupOrdering,
  showOrdering: showOrdering
};
},{"../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Ring/foreign.js":[function(require,module,exports) {
"use strict";

exports.intSub = function (x) {
  return function (y) {
    /* jshint bitwise: false */
    return x - y | 0;
  };
};

exports.numSub = function (n1) {
  return function (n2) {
    return n1 - n2;
  };
};
},{}],"../output/Data.Semiring/foreign.js":[function(require,module,exports) {
"use strict";

exports.intAdd = function (x) {
  return function (y) {
    /* jshint bitwise: false */
    return x + y | 0;
  };
};

exports.intMul = function (x) {
  return function (y) {
    /* jshint bitwise: false */
    return x * y | 0;
  };
};

exports.numAdd = function (n1) {
  return function (n2) {
    return n1 + n2;
  };
};

exports.numMul = function (n1) {
  return function (n2) {
    return n1 * n2;
  };
};
},{}],"../output/Data.Semiring/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_Row = require("../Type.Data.Row/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var SemiringRecord = function SemiringRecord(addRecord, mulRecord, oneRecord, zeroRecord) {
  this.addRecord = addRecord;
  this.mulRecord = mulRecord;
  this.oneRecord = oneRecord;
  this.zeroRecord = zeroRecord;
};

var Semiring = function Semiring(add, mul, one, zero) {
  this.add = add;
  this.mul = mul;
  this.one = one;
  this.zero = zero;
};

var zeroRecord = function zeroRecord(dict) {
  return dict.zeroRecord;
};

var zero = function zero(dict) {
  return dict.zero;
};

var semiringUnit = new Semiring(function (v) {
  return function (v1) {
    return Data_Unit.unit;
  };
}, function (v) {
  return function (v1) {
    return Data_Unit.unit;
  };
}, Data_Unit.unit, Data_Unit.unit);
var semiringRecordNil = new SemiringRecord(function (v) {
  return function (v1) {
    return function (v2) {
      return {};
    };
  };
}, function (v) {
  return function (v1) {
    return function (v2) {
      return {};
    };
  };
}, function (v) {
  return function (v1) {
    return {};
  };
}, function (v) {
  return function (v1) {
    return {};
  };
});
var semiringNumber = new Semiring($foreign.numAdd, $foreign.numMul, 1.0, 0.0);
var semiringInt = new Semiring($foreign.intAdd, $foreign.intMul, 1, 0);

var oneRecord = function oneRecord(dict) {
  return dict.oneRecord;
};

var one = function one(dict) {
  return dict.one;
};

var mulRecord = function mulRecord(dict) {
  return dict.mulRecord;
};

var mul = function mul(dict) {
  return dict.mul;
};

var addRecord = function addRecord(dict) {
  return dict.addRecord;
};

var semiringRecord = function semiringRecord(dictRowToList) {
  return function (dictSemiringRecord) {
    return new Semiring(addRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value), mulRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value), oneRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value)(Type_Data_Row.RProxy.value), zeroRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value)(Type_Data_Row.RProxy.value));
  };
};

var add = function add(dict) {
  return dict.add;
};

var semiringFn = function semiringFn(dictSemiring) {
  return new Semiring(function (f) {
    return function (g) {
      return function (x) {
        return add(dictSemiring)(f(x))(g(x));
      };
    };
  }, function (f) {
    return function (g) {
      return function (x) {
        return mul(dictSemiring)(f(x))(g(x));
      };
    };
  }, function (v) {
    return one(dictSemiring);
  }, function (v) {
    return zero(dictSemiring);
  });
};

var semiringRecordCons = function semiringRecordCons(dictIsSymbol) {
  return function (dictCons) {
    return function (dictSemiringRecord) {
      return function (dictSemiring) {
        return new SemiringRecord(function (v) {
          return function (ra) {
            return function (rb) {
              var tail = addRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var insert = Record_Unsafe.unsafeSet(key);
              var get = Record_Unsafe.unsafeGet(key);
              return insert(add(dictSemiring)(get(ra))(get(rb)))(tail);
            };
          };
        }, function (v) {
          return function (ra) {
            return function (rb) {
              var tail = mulRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var insert = Record_Unsafe.unsafeSet(key);
              var get = Record_Unsafe.unsafeGet(key);
              return insert(mul(dictSemiring)(get(ra))(get(rb)))(tail);
            };
          };
        }, function (v) {
          return function (v1) {
            var tail = oneRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value)(Type_Data_Row.RProxy.value);
            var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
            var insert = Record_Unsafe.unsafeSet(key);
            return insert(one(dictSemiring))(tail);
          };
        }, function (v) {
          return function (v1) {
            var tail = zeroRecord(dictSemiringRecord)(Type_Data_RowList.RLProxy.value)(Type_Data_Row.RProxy.value);
            var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
            var insert = Record_Unsafe.unsafeSet(key);
            return insert(zero(dictSemiring))(tail);
          };
        });
      };
    };
  };
};

module.exports = {
  Semiring: Semiring,
  add: add,
  zero: zero,
  mul: mul,
  one: one,
  SemiringRecord: SemiringRecord,
  addRecord: addRecord,
  mulRecord: mulRecord,
  oneRecord: oneRecord,
  zeroRecord: zeroRecord,
  semiringInt: semiringInt,
  semiringNumber: semiringNumber,
  semiringFn: semiringFn,
  semiringUnit: semiringUnit,
  semiringRecord: semiringRecord,
  semiringRecordNil: semiringRecordNil,
  semiringRecordCons: semiringRecordCons
};
},{"./foreign.js":"../output/Data.Semiring/foreign.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.Row/index.js":"../output/Type.Data.Row/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Data.Ring/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var RingRecord = function RingRecord(SemiringRecord0, subRecord) {
  this.SemiringRecord0 = SemiringRecord0;
  this.subRecord = subRecord;
};

var Ring = function Ring(Semiring0, sub) {
  this.Semiring0 = Semiring0;
  this.sub = sub;
};

var subRecord = function subRecord(dict) {
  return dict.subRecord;
};

var sub = function sub(dict) {
  return dict.sub;
};

var ringUnit = new Ring(function () {
  return Data_Semiring.semiringUnit;
}, function (v) {
  return function (v1) {
    return Data_Unit.unit;
  };
});
var ringRecordNil = new RingRecord(function () {
  return Data_Semiring.semiringRecordNil;
}, function (v) {
  return function (v1) {
    return function (v2) {
      return {};
    };
  };
});

var ringRecordCons = function ringRecordCons(dictIsSymbol) {
  return function (dictCons) {
    return function (dictRingRecord) {
      return function (dictRing) {
        return new RingRecord(function () {
          return Data_Semiring.semiringRecordCons(dictIsSymbol)()(dictRingRecord.SemiringRecord0())(dictRing.Semiring0());
        }, function (v) {
          return function (ra) {
            return function (rb) {
              var tail = subRecord(dictRingRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var insert = Record_Unsafe.unsafeSet(key);
              var get = Record_Unsafe.unsafeGet(key);
              return insert(sub(dictRing)(get(ra))(get(rb)))(tail);
            };
          };
        });
      };
    };
  };
};

var ringRecord = function ringRecord(dictRowToList) {
  return function (dictRingRecord) {
    return new Ring(function () {
      return Data_Semiring.semiringRecord()(dictRingRecord.SemiringRecord0());
    }, subRecord(dictRingRecord)(Type_Data_RowList.RLProxy.value));
  };
};

var ringNumber = new Ring(function () {
  return Data_Semiring.semiringNumber;
}, $foreign.numSub);
var ringInt = new Ring(function () {
  return Data_Semiring.semiringInt;
}, $foreign.intSub);

var ringFn = function ringFn(dictRing) {
  return new Ring(function () {
    return Data_Semiring.semiringFn(dictRing.Semiring0());
  }, function (f) {
    return function (g) {
      return function (x) {
        return sub(dictRing)(f(x))(g(x));
      };
    };
  });
};

var negate = function negate(dictRing) {
  return function (a) {
    return sub(dictRing)(Data_Semiring.zero(dictRing.Semiring0()))(a);
  };
};

module.exports = {
  Ring: Ring,
  sub: sub,
  negate: negate,
  RingRecord: RingRecord,
  subRecord: subRecord,
  ringInt: ringInt,
  ringNumber: ringNumber,
  ringUnit: ringUnit,
  ringFn: ringFn,
  ringRecord: ringRecord,
  ringRecordNil: ringRecordNil,
  ringRecordCons: ringRecordCons
};
},{"./foreign.js":"../output/Data.Ring/foreign.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Data.Ord/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Ring = require("../Data.Ring/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var OrdRecord = function OrdRecord(EqRecord0, compareRecord) {
  this.EqRecord0 = EqRecord0;
  this.compareRecord = compareRecord;
};

var Ord1 = function Ord1(Eq10, compare1) {
  this.Eq10 = Eq10;
  this.compare1 = compare1;
};

var Ord = function Ord(Eq0, compare) {
  this.Eq0 = Eq0;
  this.compare = compare;
};

var ordVoid = new Ord(function () {
  return Data_Eq.eqVoid;
}, function (v) {
  return function (v1) {
    return Data_Ordering.EQ.value;
  };
});
var ordUnit = new Ord(function () {
  return Data_Eq.eqUnit;
}, function (v) {
  return function (v1) {
    return Data_Ordering.EQ.value;
  };
});
var ordString = new Ord(function () {
  return Data_Eq.eqString;
}, $foreign.ordStringImpl(Data_Ordering.LT.value)(Data_Ordering.EQ.value)(Data_Ordering.GT.value));
var ordRecordNil = new OrdRecord(function () {
  return Data_Eq.eqRowNil;
}, function (v) {
  return function (v1) {
    return function (v2) {
      return Data_Ordering.EQ.value;
    };
  };
});
var ordOrdering = new Ord(function () {
  return Data_Ordering.eqOrdering;
}, function (v) {
  return function (v1) {
    if (v instanceof Data_Ordering.LT && v1 instanceof Data_Ordering.LT) {
      return Data_Ordering.EQ.value;
    }

    ;

    if (v instanceof Data_Ordering.EQ && v1 instanceof Data_Ordering.EQ) {
      return Data_Ordering.EQ.value;
    }

    ;

    if (v instanceof Data_Ordering.GT && v1 instanceof Data_Ordering.GT) {
      return Data_Ordering.EQ.value;
    }

    ;

    if (v instanceof Data_Ordering.LT) {
      return Data_Ordering.LT.value;
    }

    ;

    if (v instanceof Data_Ordering.EQ && v1 instanceof Data_Ordering.LT) {
      return Data_Ordering.GT.value;
    }

    ;

    if (v instanceof Data_Ordering.EQ && v1 instanceof Data_Ordering.GT) {
      return Data_Ordering.LT.value;
    }

    ;

    if (v instanceof Data_Ordering.GT) {
      return Data_Ordering.GT.value;
    }

    ;
    throw new Error("Failed pattern match at Data.Ord (line 112, column 1 - line 119, column 21): " + [v.constructor.name, v1.constructor.name]);
  };
});
var ordNumber = new Ord(function () {
  return Data_Eq.eqNumber;
}, $foreign.ordNumberImpl(Data_Ordering.LT.value)(Data_Ordering.EQ.value)(Data_Ordering.GT.value));
var ordInt = new Ord(function () {
  return Data_Eq.eqInt;
}, $foreign.ordIntImpl(Data_Ordering.LT.value)(Data_Ordering.EQ.value)(Data_Ordering.GT.value));
var ordChar = new Ord(function () {
  return Data_Eq.eqChar;
}, $foreign.ordCharImpl(Data_Ordering.LT.value)(Data_Ordering.EQ.value)(Data_Ordering.GT.value));
var ordBoolean = new Ord(function () {
  return Data_Eq.eqBoolean;
}, $foreign.ordBooleanImpl(Data_Ordering.LT.value)(Data_Ordering.EQ.value)(Data_Ordering.GT.value));

var compareRecord = function compareRecord(dict) {
  return dict.compareRecord;
};

var ordRecord = function ordRecord(dictRowToList) {
  return function (dictOrdRecord) {
    return new Ord(function () {
      return Data_Eq.eqRec()(dictOrdRecord.EqRecord0());
    }, compareRecord(dictOrdRecord)(Type_Data_RowList.RLProxy.value));
  };
};

var compare1 = function compare1(dict) {
  return dict.compare1;
};

var compare = function compare(dict) {
  return dict.compare;
};

var comparing = function comparing(dictOrd) {
  return function (f) {
    return function (x) {
      return function (y) {
        return compare(dictOrd)(f(x))(f(y));
      };
    };
  };
};

var greaterThan = function greaterThan(dictOrd) {
  return function (a1) {
    return function (a2) {
      var v = compare(dictOrd)(a1)(a2);

      if (v instanceof Data_Ordering.GT) {
        return true;
      }

      ;
      return false;
    };
  };
};

var greaterThanOrEq = function greaterThanOrEq(dictOrd) {
  return function (a1) {
    return function (a2) {
      var v = compare(dictOrd)(a1)(a2);

      if (v instanceof Data_Ordering.LT) {
        return false;
      }

      ;
      return true;
    };
  };
};

var signum = function signum(dictOrd) {
  return function (dictRing) {
    return function (x) {
      var $43 = greaterThanOrEq(dictOrd)(x)(Data_Semiring.zero(dictRing.Semiring0()));

      if ($43) {
        return Data_Semiring.one(dictRing.Semiring0());
      }

      ;
      return Data_Ring.negate(dictRing)(Data_Semiring.one(dictRing.Semiring0()));
    };
  };
};

var lessThan = function lessThan(dictOrd) {
  return function (a1) {
    return function (a2) {
      var v = compare(dictOrd)(a1)(a2);

      if (v instanceof Data_Ordering.LT) {
        return true;
      }

      ;
      return false;
    };
  };
};

var lessThanOrEq = function lessThanOrEq(dictOrd) {
  return function (a1) {
    return function (a2) {
      var v = compare(dictOrd)(a1)(a2);

      if (v instanceof Data_Ordering.GT) {
        return false;
      }

      ;
      return true;
    };
  };
};

var max = function max(dictOrd) {
  return function (x) {
    return function (y) {
      var v = compare(dictOrd)(x)(y);

      if (v instanceof Data_Ordering.LT) {
        return y;
      }

      ;

      if (v instanceof Data_Ordering.EQ) {
        return x;
      }

      ;

      if (v instanceof Data_Ordering.GT) {
        return x;
      }

      ;
      throw new Error("Failed pattern match at Data.Ord (line 167, column 3 - line 170, column 12): " + [v.constructor.name]);
    };
  };
};

var min = function min(dictOrd) {
  return function (x) {
    return function (y) {
      var v = compare(dictOrd)(x)(y);

      if (v instanceof Data_Ordering.LT) {
        return x;
      }

      ;

      if (v instanceof Data_Ordering.EQ) {
        return x;
      }

      ;

      if (v instanceof Data_Ordering.GT) {
        return y;
      }

      ;
      throw new Error("Failed pattern match at Data.Ord (line 158, column 3 - line 161, column 12): " + [v.constructor.name]);
    };
  };
};

var ordArray = function ordArray(dictOrd) {
  return new Ord(function () {
    return Data_Eq.eqArray(dictOrd.Eq0());
  }, function () {
    var toDelta = function toDelta(x) {
      return function (y) {
        var v = compare(dictOrd)(x)(y);

        if (v instanceof Data_Ordering.EQ) {
          return 0;
        }

        ;

        if (v instanceof Data_Ordering.LT) {
          return 1;
        }

        ;

        if (v instanceof Data_Ordering.GT) {
          return -1 | 0;
        }

        ;
        throw new Error("Failed pattern match at Data.Ord (line 65, column 7 - line 68, column 17): " + [v.constructor.name]);
      };
    };

    return function (xs) {
      return function (ys) {
        return compare(ordInt)(0)($foreign.ordArrayImpl(toDelta)(xs)(ys));
      };
    };
  }());
};

var ord1Array = new Ord1(function () {
  return Data_Eq.eq1Array;
}, function (dictOrd) {
  return compare(ordArray(dictOrd));
});

var ordRecordCons = function ordRecordCons(dictOrdRecord) {
  return function (dictCons) {
    return function (dictIsSymbol) {
      return function (dictOrd) {
        return new OrdRecord(function () {
          return Data_Eq.eqRowCons(dictOrdRecord.EqRecord0())()(dictIsSymbol)(dictOrd.Eq0());
        }, function (v) {
          return function (ra) {
            return function (rb) {
              var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              var left = compare(dictOrd)(Record_Unsafe.unsafeGet(key)(ra))(Record_Unsafe.unsafeGet(key)(rb));
              var $49 = Data_Eq.notEq(Data_Ordering.eqOrdering)(left)(Data_Ordering.EQ.value);

              if ($49) {
                return left;
              }

              ;
              return compareRecord(dictOrdRecord)(Type_Data_RowList.RLProxy.value)(ra)(rb);
            };
          };
        });
      };
    };
  };
};

var clamp = function clamp(dictOrd) {
  return function (low) {
    return function (hi) {
      return function (x) {
        return min(dictOrd)(hi)(max(dictOrd)(low)(x));
      };
    };
  };
};

var between = function between(dictOrd) {
  return function (low) {
    return function (hi) {
      return function (x) {
        if (lessThan(dictOrd)(x)(low)) {
          return false;
        }

        ;

        if (greaterThan(dictOrd)(x)(hi)) {
          return false;
        }

        ;
        return true;
      };
    };
  };
};

var abs = function abs(dictOrd) {
  return function (dictRing) {
    return function (x) {
      var $53 = greaterThanOrEq(dictOrd)(x)(Data_Semiring.zero(dictRing.Semiring0()));

      if ($53) {
        return x;
      }

      ;
      return Data_Ring.negate(dictRing)(x);
    };
  };
};

module.exports = {
  Ord: Ord,
  compare: compare,
  Ord1: Ord1,
  compare1: compare1,
  lessThan: lessThan,
  lessThanOrEq: lessThanOrEq,
  greaterThan: greaterThan,
  greaterThanOrEq: greaterThanOrEq,
  comparing: comparing,
  min: min,
  max: max,
  clamp: clamp,
  between: between,
  abs: abs,
  signum: signum,
  OrdRecord: OrdRecord,
  compareRecord: compareRecord,
  ordBoolean: ordBoolean,
  ordInt: ordInt,
  ordNumber: ordNumber,
  ordString: ordString,
  ordChar: ordChar,
  ordUnit: ordUnit,
  ordVoid: ordVoid,
  ordArray: ordArray,
  ordOrdering: ordOrdering,
  ord1Array: ord1Array,
  ordRecordNil: ordRecordNil,
  ordRecordCons: ordRecordCons,
  ordRecord: ordRecord
};
},{"./foreign.js":"../output/Data.Ord/foreign.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Ring/index.js":"../output/Data.Ring/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Data.Bounded/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Bounded = function Bounded(Ord0, bottom, top) {
  this.Ord0 = Ord0;
  this.bottom = bottom;
  this.top = top;
};

var top = function top(dict) {
  return dict.top;
};

var boundedUnit = new Bounded(function () {
  return Data_Ord.ordUnit;
}, Data_Unit.unit, Data_Unit.unit);
var boundedOrdering = new Bounded(function () {
  return Data_Ord.ordOrdering;
}, Data_Ordering.LT.value, Data_Ordering.GT.value);
var boundedNumber = new Bounded(function () {
  return Data_Ord.ordNumber;
}, $foreign.bottomNumber, $foreign.topNumber);
var boundedInt = new Bounded(function () {
  return Data_Ord.ordInt;
}, $foreign.bottomInt, $foreign.topInt);
var boundedChar = new Bounded(function () {
  return Data_Ord.ordChar;
}, $foreign.bottomChar, $foreign.topChar);
var boundedBoolean = new Bounded(function () {
  return Data_Ord.ordBoolean;
}, false, true);

var bottom = function bottom(dict) {
  return dict.bottom;
};

module.exports = {
  Bounded: Bounded,
  bottom: bottom,
  top: top,
  boundedBoolean: boundedBoolean,
  boundedInt: boundedInt,
  boundedChar: boundedChar,
  boundedOrdering: boundedOrdering,
  boundedUnit: boundedUnit,
  boundedNumber: boundedNumber
};
},{"./foreign.js":"../output/Data.Bounded/foreign.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Functor.Invariant/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Functor = require("../Data.Functor/index.js");

var Invariant = function Invariant(imap) {
  this.imap = imap;
};

var invariantMultiplicative = new Invariant(function (f) {
  return function (v) {
    return function (v1) {
      return f(v1);
    };
  };
});
var invariantEndo = new Invariant(function (ab) {
  return function (ba) {
    return function (v) {
      return function ($31) {
        return ab(v(ba($31)));
      };
    };
  };
});
var invariantDual = new Invariant(function (f) {
  return function (v) {
    return function (v1) {
      return f(v1);
    };
  };
});
var invariantDisj = new Invariant(function (f) {
  return function (v) {
    return function (v1) {
      return f(v1);
    };
  };
});
var invariantConj = new Invariant(function (f) {
  return function (v) {
    return function (v1) {
      return f(v1);
    };
  };
});
var invariantAdditive = new Invariant(function (f) {
  return function (v) {
    return function (v1) {
      return f(v1);
    };
  };
});

var imapF = function imapF(dictFunctor) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictFunctor)(f);
    };
  };
};

var invariantArray = new Invariant(imapF(Data_Functor.functorArray));
var invariantFn = new Invariant(imapF(Data_Functor.functorFn));

var imap = function imap(dict) {
  return dict.imap;
};

module.exports = {
  imap: imap,
  Invariant: Invariant,
  imapF: imapF,
  invariantFn: invariantFn,
  invariantArray: invariantArray,
  invariantAdditive: invariantAdditive,
  invariantConj: invariantConj,
  invariantDisj: invariantDisj,
  invariantDual: invariantDual,
  invariantEndo: invariantEndo,
  invariantMultiplicative: invariantMultiplicative
};
},{"../Data.Functor/index.js":"../output/Data.Functor/index.js"}],"../output/Data.EuclideanRing/foreign.js":[function(require,module,exports) {
"use strict";

exports.intDegree = function (x) {
  return Math.min(Math.abs(x), 2147483647);
}; // See the Euclidean definition in
// https://en.m.wikipedia.org/wiki/Modulo_operation.


exports.intDiv = function (x) {
  return function (y) {
    if (y === 0) return 0;
    return y > 0 ? Math.floor(x / y) : -Math.floor(x / -y);
  };
};

exports.intMod = function (x) {
  return function (y) {
    if (y === 0) return 0;
    var yy = Math.abs(y);
    return (x % yy + yy) % yy;
  };
};

exports.numDiv = function (n1) {
  return function (n2) {
    return n1 / n2;
  };
};
},{}],"../output/Data.CommutativeRing/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Ring = require("../Data.Ring/index.js");

var CommutativeRingRecord = function CommutativeRingRecord(RingRecord0) {
  this.RingRecord0 = RingRecord0;
};

var CommutativeRing = function CommutativeRing(Ring0) {
  this.Ring0 = Ring0;
};

var commutativeRingUnit = new CommutativeRing(function () {
  return Data_Ring.ringUnit;
});
var commutativeRingRecordNil = new CommutativeRingRecord(function () {
  return Data_Ring.ringRecordNil;
});

var commutativeRingRecordCons = function commutativeRingRecordCons(dictIsSymbol) {
  return function (dictCons) {
    return function (dictCommutativeRingRecord) {
      return function (dictCommutativeRing) {
        return new CommutativeRingRecord(function () {
          return Data_Ring.ringRecordCons(dictIsSymbol)()(dictCommutativeRingRecord.RingRecord0())(dictCommutativeRing.Ring0());
        });
      };
    };
  };
};

var commutativeRingRecord = function commutativeRingRecord(dictRowToList) {
  return function (dictCommutativeRingRecord) {
    return new CommutativeRing(function () {
      return Data_Ring.ringRecord()(dictCommutativeRingRecord.RingRecord0());
    });
  };
};

var commutativeRingNumber = new CommutativeRing(function () {
  return Data_Ring.ringNumber;
});
var commutativeRingInt = new CommutativeRing(function () {
  return Data_Ring.ringInt;
});

var commutativeRingFn = function commutativeRingFn(dictCommutativeRing) {
  return new CommutativeRing(function () {
    return Data_Ring.ringFn(dictCommutativeRing.Ring0());
  });
};

module.exports = {
  CommutativeRing: CommutativeRing,
  CommutativeRingRecord: CommutativeRingRecord,
  commutativeRingInt: commutativeRingInt,
  commutativeRingNumber: commutativeRingNumber,
  commutativeRingUnit: commutativeRingUnit,
  commutativeRingFn: commutativeRingFn,
  commutativeRingRecord: commutativeRingRecord,
  commutativeRingRecordNil: commutativeRingRecordNil,
  commutativeRingRecordCons: commutativeRingRecordCons
};
},{"../Data.Ring/index.js":"../output/Data.Ring/index.js"}],"../output/Data.EuclideanRing/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_CommutativeRing = require("../Data.CommutativeRing/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var EuclideanRing = function EuclideanRing(CommutativeRing0, degree, div, mod) {
  this.CommutativeRing0 = CommutativeRing0;
  this.degree = degree;
  this.div = div;
  this.mod = mod;
};

var mod = function mod(dict) {
  return dict.mod;
};

var gcd = function gcd($copy_dictEq) {
  return function ($copy_dictEuclideanRing) {
    return function ($copy_a) {
      return function ($copy_b) {
        var $tco_var_dictEq = $copy_dictEq;
        var $tco_var_dictEuclideanRing = $copy_dictEuclideanRing;
        var $tco_var_a = $copy_a;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(dictEq, dictEuclideanRing, a, b) {
          var $7 = Data_Eq.eq(dictEq)(b)(Data_Semiring.zero(dictEuclideanRing.CommutativeRing0().Ring0().Semiring0()));

          if ($7) {
            $tco_done = true;
            return a;
          }

          ;
          $tco_var_dictEq = dictEq;
          $tco_var_dictEuclideanRing = dictEuclideanRing;
          $tco_var_a = b;
          $copy_b = mod(dictEuclideanRing)(a)(b);
          return;
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_dictEq, $tco_var_dictEuclideanRing, $tco_var_a, $copy_b);
        }

        ;
        return $tco_result;
      };
    };
  };
};

var euclideanRingNumber = new EuclideanRing(function () {
  return Data_CommutativeRing.commutativeRingNumber;
}, function (v) {
  return 1;
}, $foreign.numDiv, function (v) {
  return function (v1) {
    return 0.0;
  };
});
var euclideanRingInt = new EuclideanRing(function () {
  return Data_CommutativeRing.commutativeRingInt;
}, $foreign.intDegree, $foreign.intDiv, $foreign.intMod);

var div = function div(dict) {
  return dict.div;
};

var lcm = function lcm(dictEq) {
  return function (dictEuclideanRing) {
    return function (a) {
      return function (b) {
        var $8 = Data_Eq.eq(dictEq)(a)(Data_Semiring.zero(dictEuclideanRing.CommutativeRing0().Ring0().Semiring0())) || Data_Eq.eq(dictEq)(b)(Data_Semiring.zero(dictEuclideanRing.CommutativeRing0().Ring0().Semiring0()));

        if ($8) {
          return Data_Semiring.zero(dictEuclideanRing.CommutativeRing0().Ring0().Semiring0());
        }

        ;
        return div(dictEuclideanRing)(Data_Semiring.mul(dictEuclideanRing.CommutativeRing0().Ring0().Semiring0())(a)(b))(gcd(dictEq)(dictEuclideanRing)(a)(b));
      };
    };
  };
};

var degree = function degree(dict) {
  return dict.degree;
};

module.exports = {
  EuclideanRing: EuclideanRing,
  degree: degree,
  div: div,
  mod: mod,
  gcd: gcd,
  lcm: lcm,
  euclideanRingInt: euclideanRingInt,
  euclideanRingNumber: euclideanRingNumber
};
},{"./foreign.js":"../output/Data.EuclideanRing/foreign.js","../Data.CommutativeRing/index.js":"../output/Data.CommutativeRing/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js"}],"../output/Data.Monoid/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_EuclideanRing = require("../Data.EuclideanRing/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var MonoidRecord = function MonoidRecord(SemigroupRecord0, memptyRecord) {
  this.SemigroupRecord0 = SemigroupRecord0;
  this.memptyRecord = memptyRecord;
};

var Monoid = function Monoid(Semigroup0, mempty) {
  this.Semigroup0 = Semigroup0;
  this.mempty = mempty;
};

var monoidUnit = new Monoid(function () {
  return Data_Semigroup.semigroupUnit;
}, Data_Unit.unit);
var monoidString = new Monoid(function () {
  return Data_Semigroup.semigroupString;
}, "");
var monoidRecordNil = new MonoidRecord(function () {
  return Data_Semigroup.semigroupRecordNil;
}, function (v) {
  return {};
});
var monoidOrdering = new Monoid(function () {
  return Data_Ordering.semigroupOrdering;
}, Data_Ordering.EQ.value);
var monoidArray = new Monoid(function () {
  return Data_Semigroup.semigroupArray;
}, []);

var memptyRecord = function memptyRecord(dict) {
  return dict.memptyRecord;
};

var monoidRecord = function monoidRecord(dictRowToList) {
  return function (dictMonoidRecord) {
    return new Monoid(function () {
      return Data_Semigroup.semigroupRecord()(dictMonoidRecord.SemigroupRecord0());
    }, memptyRecord(dictMonoidRecord)(Type_Data_RowList.RLProxy.value));
  };
};

var mempty = function mempty(dict) {
  return dict.mempty;
};

var monoidFn = function monoidFn(dictMonoid) {
  return new Monoid(function () {
    return Data_Semigroup.semigroupFn(dictMonoid.Semigroup0());
  }, function (v) {
    return mempty(dictMonoid);
  });
};

var monoidRecordCons = function monoidRecordCons(dictIsSymbol) {
  return function (dictMonoid) {
    return function (dictCons) {
      return function (dictMonoidRecord) {
        return new MonoidRecord(function () {
          return Data_Semigroup.semigroupRecordCons(dictIsSymbol)()(dictMonoidRecord.SemigroupRecord0())(dictMonoid.Semigroup0());
        }, function (v) {
          var tail = memptyRecord(dictMonoidRecord)(Type_Data_RowList.RLProxy.value);
          var key = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
          var insert = Record_Unsafe.unsafeSet(key);
          return insert(mempty(dictMonoid))(tail);
        });
      };
    };
  };
};

var power = function power(dictMonoid) {
  return function (x) {
    var go = function go(p) {
      if (p <= 0) {
        return mempty(dictMonoid);
      }

      ;

      if (p === 1) {
        return x;
      }

      ;

      if (Data_EuclideanRing.mod(Data_EuclideanRing.euclideanRingInt)(p)(2) === 0) {
        var x$prime = go(Data_EuclideanRing.div(Data_EuclideanRing.euclideanRingInt)(p)(2));
        return Data_Semigroup.append(dictMonoid.Semigroup0())(x$prime)(x$prime);
      }

      ;

      if (Data_Boolean.otherwise) {
        var x$prime = go(Data_EuclideanRing.div(Data_EuclideanRing.euclideanRingInt)(p)(2));
        return Data_Semigroup.append(dictMonoid.Semigroup0())(x$prime)(Data_Semigroup.append(dictMonoid.Semigroup0())(x$prime)(x));
      }

      ;
      throw new Error("Failed pattern match at Data.Monoid (line 65, column 3 - line 65, column 17): " + [p.constructor.name]);
    };

    return go;
  };
};

var guard = function guard(dictMonoid) {
  return function (v) {
    return function (v1) {
      if (v) {
        return v1;
      }

      ;

      if (!v) {
        return mempty(dictMonoid);
      }

      ;
      throw new Error("Failed pattern match at Data.Monoid (line 73, column 1 - line 73, column 49): " + [v.constructor.name, v1.constructor.name]);
    };
  };
};

module.exports = {
  Monoid: Monoid,
  mempty: mempty,
  power: power,
  guard: guard,
  MonoidRecord: MonoidRecord,
  memptyRecord: memptyRecord,
  monoidUnit: monoidUnit,
  monoidOrdering: monoidOrdering,
  monoidFn: monoidFn,
  monoidString: monoidString,
  monoidArray: monoidArray,
  monoidRecord: monoidRecord,
  monoidRecordNil: monoidRecordNil,
  monoidRecordCons: monoidRecordCons
};
},{"../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.EuclideanRing/index.js":"../output/Data.EuclideanRing/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js"}],"../output/Data.Maybe/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Extend = require("../Control.Extend/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Invariant = require("../Data.Functor.Invariant/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Nothing = function () {
  function Nothing() {}

  ;
  Nothing.value = new Nothing();
  return Nothing;
}();

var Just = function () {
  function Just(value0) {
    this.value0 = value0;
  }

  ;

  Just.create = function (value0) {
    return new Just(value0);
  };

  return Just;
}();

var showMaybe = function showMaybe(dictShow) {
  return new Data_Show.Show(function (v) {
    if (v instanceof Just) {
      return "(Just " + (Data_Show.show(dictShow)(v.value0) + ")");
    }

    ;

    if (v instanceof Nothing) {
      return "Nothing";
    }

    ;
    throw new Error("Failed pattern match at Data.Maybe (line 205, column 1 - line 207, column 28): " + [v.constructor.name]);
  });
};

var semigroupMaybe = function semigroupMaybe(dictSemigroup) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      if (v instanceof Nothing) {
        return v1;
      }

      ;

      if (v1 instanceof Nothing) {
        return v;
      }

      ;

      if (v instanceof Just && v1 instanceof Just) {
        return new Just(Data_Semigroup.append(dictSemigroup)(v.value0)(v1.value0));
      }

      ;
      throw new Error("Failed pattern match at Data.Maybe (line 174, column 1 - line 177, column 43): " + [v.constructor.name, v1.constructor.name]);
    };
  });
};

var optional = function optional(dictAlternative) {
  return function (a) {
    return Control_Alt.alt(dictAlternative.Plus1().Alt0())(Data_Functor.map(dictAlternative.Plus1().Alt0().Functor0())(Just.create)(a))(Control_Applicative.pure(dictAlternative.Applicative0())(Nothing.value));
  };
};

var monoidMaybe = function monoidMaybe(dictSemigroup) {
  return new Data_Monoid.Monoid(function () {
    return semigroupMaybe(dictSemigroup);
  }, Nothing.value);
};

var maybe$prime = function maybe$prime(v) {
  return function (v1) {
    return function (v2) {
      if (v2 instanceof Nothing) {
        return v(Data_Unit.unit);
      }

      ;

      if (v2 instanceof Just) {
        return v1(v2.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Maybe (line 230, column 1 - line 230, column 62): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
    };
  };
};

var maybe = function maybe(v) {
  return function (v1) {
    return function (v2) {
      if (v2 instanceof Nothing) {
        return v;
      }

      ;

      if (v2 instanceof Just) {
        return v1(v2.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
    };
  };
};

var isNothing = maybe(true)(Data_Function["const"](false));
var isJust = maybe(false)(Data_Function["const"](true));
var functorMaybe = new Data_Functor.Functor(function (v) {
  return function (v1) {
    if (v1 instanceof Just) {
      return new Just(v(v1.value0));
    }

    ;
    return Nothing.value;
  };
});
var invariantMaybe = new Data_Functor_Invariant.Invariant(Data_Functor_Invariant.imapF(functorMaybe));

var fromMaybe$prime = function fromMaybe$prime(a) {
  return maybe$prime(a)(Control_Category.identity(Control_Category.categoryFn));
};

var fromMaybe = function fromMaybe(a) {
  return maybe(a)(Control_Category.identity(Control_Category.categoryFn));
};

var fromJust = function fromJust(dictPartial) {
  return function (v) {
    if (v instanceof Just) {
      return v.value0;
    }

    ;
    throw new Error("Failed pattern match at Data.Maybe (line 268, column 1 - line 268, column 46): " + [v.constructor.name]);
  };
};

var extendMaybe = new Control_Extend.Extend(function () {
  return functorMaybe;
}, function (v) {
  return function (v1) {
    if (v1 instanceof Nothing) {
      return Nothing.value;
    }

    ;
    return new Just(v(v1));
  };
});

var eqMaybe = function eqMaybe(dictEq) {
  return new Data_Eq.Eq(function (x) {
    return function (y) {
      if (x instanceof Nothing && y instanceof Nothing) {
        return true;
      }

      ;

      if (x instanceof Just && y instanceof Just) {
        return Data_Eq.eq(dictEq)(x.value0)(y.value0);
      }

      ;
      return false;
    };
  });
};

var ordMaybe = function ordMaybe(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqMaybe(dictOrd.Eq0());
  }, function (x) {
    return function (y) {
      if (x instanceof Nothing && y instanceof Nothing) {
        return Data_Ordering.EQ.value;
      }

      ;

      if (x instanceof Nothing) {
        return Data_Ordering.LT.value;
      }

      ;

      if (y instanceof Nothing) {
        return Data_Ordering.GT.value;
      }

      ;

      if (x instanceof Just && y instanceof Just) {
        return Data_Ord.compare(dictOrd)(x.value0)(y.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Maybe (line 194, column 1 - line 194, column 51): " + [x.constructor.name, y.constructor.name]);
    };
  });
};

var eq1Maybe = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqMaybe(dictEq));
});
var ord1Maybe = new Data_Ord.Ord1(function () {
  return eq1Maybe;
}, function (dictOrd) {
  return Data_Ord.compare(ordMaybe(dictOrd));
});

var boundedMaybe = function boundedMaybe(dictBounded) {
  return new Data_Bounded.Bounded(function () {
    return ordMaybe(dictBounded.Ord0());
  }, Nothing.value, new Just(Data_Bounded.top(dictBounded)));
};

var applyMaybe = new Control_Apply.Apply(function () {
  return functorMaybe;
}, function (v) {
  return function (v1) {
    if (v instanceof Just) {
      return Data_Functor.map(functorMaybe)(v.value0)(v1);
    }

    ;

    if (v instanceof Nothing) {
      return Nothing.value;
    }

    ;
    throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): " + [v.constructor.name, v1.constructor.name]);
  };
});
var bindMaybe = new Control_Bind.Bind(function () {
  return applyMaybe;
}, function (v) {
  return function (v1) {
    if (v instanceof Just) {
      return v1(v.value0);
    }

    ;

    if (v instanceof Nothing) {
      return Nothing.value;
    }

    ;
    throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): " + [v.constructor.name, v1.constructor.name]);
  };
});
var applicativeMaybe = new Control_Applicative.Applicative(function () {
  return applyMaybe;
}, Just.create);
var monadMaybe = new Control_Monad.Monad(function () {
  return applicativeMaybe;
}, function () {
  return bindMaybe;
});
var altMaybe = new Control_Alt.Alt(function () {
  return functorMaybe;
}, function (v) {
  return function (v1) {
    if (v instanceof Nothing) {
      return v1;
    }

    ;
    return v;
  };
});
var plusMaybe = new Control_Plus.Plus(function () {
  return altMaybe;
}, Nothing.value);
var alternativeMaybe = new Control_Alternative.Alternative(function () {
  return applicativeMaybe;
}, function () {
  return plusMaybe;
});
var monadZeroMaybe = new Control_MonadZero.MonadZero(function () {
  return alternativeMaybe;
}, function () {
  return monadMaybe;
});
module.exports = {
  Nothing: Nothing,
  Just: Just,
  maybe: maybe,
  "maybe'": maybe$prime,
  fromMaybe: fromMaybe,
  "fromMaybe'": fromMaybe$prime,
  isJust: isJust,
  isNothing: isNothing,
  fromJust: fromJust,
  optional: optional,
  functorMaybe: functorMaybe,
  applyMaybe: applyMaybe,
  applicativeMaybe: applicativeMaybe,
  altMaybe: altMaybe,
  plusMaybe: plusMaybe,
  alternativeMaybe: alternativeMaybe,
  bindMaybe: bindMaybe,
  monadMaybe: monadMaybe,
  monadZeroMaybe: monadZeroMaybe,
  extendMaybe: extendMaybe,
  invariantMaybe: invariantMaybe,
  semigroupMaybe: semigroupMaybe,
  monoidMaybe: monoidMaybe,
  eqMaybe: eqMaybe,
  eq1Maybe: eq1Maybe,
  ordMaybe: ordMaybe,
  ord1Maybe: ord1Maybe,
  boundedMaybe: boundedMaybe,
  showMaybe: showMaybe
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Extend/index.js":"../output/Control.Extend/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Invariant/index.js":"../output/Data.Functor.Invariant/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Monoid.Conj/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Conj = function Conj(x) {
  return x;
};

var showConj = function showConj(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Conj " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semiringConj = function semiringConj(dictHeytingAlgebra) {
  return new Data_Semiring.Semiring(function (v) {
    return function (v1) {
      return Data_HeytingAlgebra.conj(dictHeytingAlgebra)(v)(v1);
    };
  }, function (v) {
    return function (v1) {
      return Data_HeytingAlgebra.disj(dictHeytingAlgebra)(v)(v1);
    };
  }, Data_HeytingAlgebra.ff(dictHeytingAlgebra), Data_HeytingAlgebra.tt(dictHeytingAlgebra));
};

var semigroupConj = function semigroupConj(dictHeytingAlgebra) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Data_HeytingAlgebra.conj(dictHeytingAlgebra)(v)(v1);
    };
  });
};

var ordConj = function ordConj(dictOrd) {
  return dictOrd;
};

var monoidConj = function monoidConj(dictHeytingAlgebra) {
  return new Data_Monoid.Monoid(function () {
    return semigroupConj(dictHeytingAlgebra);
  }, Data_HeytingAlgebra.tt(dictHeytingAlgebra));
};

var functorConj = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});

var eqConj = function eqConj(dictEq) {
  return dictEq;
};

var eq1Conj = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqConj(dictEq));
});
var ord1Conj = new Data_Ord.Ord1(function () {
  return eq1Conj;
}, function (dictOrd) {
  return Data_Ord.compare(ordConj(dictOrd));
});

var boundedConj = function boundedConj(dictBounded) {
  return dictBounded;
};

var applyConj = new Control_Apply.Apply(function () {
  return functorConj;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindConj = new Control_Bind.Bind(function () {
  return applyConj;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeConj = new Control_Applicative.Applicative(function () {
  return applyConj;
}, Conj);
var monadConj = new Control_Monad.Monad(function () {
  return applicativeConj;
}, function () {
  return bindConj;
});
module.exports = {
  Conj: Conj,
  eqConj: eqConj,
  eq1Conj: eq1Conj,
  ordConj: ordConj,
  ord1Conj: ord1Conj,
  boundedConj: boundedConj,
  showConj: showConj,
  functorConj: functorConj,
  applyConj: applyConj,
  applicativeConj: applicativeConj,
  bindConj: bindConj,
  monadConj: monadConj,
  semigroupConj: semigroupConj,
  monoidConj: monoidConj,
  semiringConj: semiringConj
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Monoid.Disj/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Disj = function Disj(x) {
  return x;
};

var showDisj = function showDisj(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Disj " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semiringDisj = function semiringDisj(dictHeytingAlgebra) {
  return new Data_Semiring.Semiring(function (v) {
    return function (v1) {
      return Data_HeytingAlgebra.disj(dictHeytingAlgebra)(v)(v1);
    };
  }, function (v) {
    return function (v1) {
      return Data_HeytingAlgebra.conj(dictHeytingAlgebra)(v)(v1);
    };
  }, Data_HeytingAlgebra.tt(dictHeytingAlgebra), Data_HeytingAlgebra.ff(dictHeytingAlgebra));
};

var semigroupDisj = function semigroupDisj(dictHeytingAlgebra) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Data_HeytingAlgebra.disj(dictHeytingAlgebra)(v)(v1);
    };
  });
};

var ordDisj = function ordDisj(dictOrd) {
  return dictOrd;
};

var monoidDisj = function monoidDisj(dictHeytingAlgebra) {
  return new Data_Monoid.Monoid(function () {
    return semigroupDisj(dictHeytingAlgebra);
  }, Data_HeytingAlgebra.ff(dictHeytingAlgebra));
};

var functorDisj = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});

var eqDisj = function eqDisj(dictEq) {
  return dictEq;
};

var eq1Disj = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqDisj(dictEq));
});
var ord1Disj = new Data_Ord.Ord1(function () {
  return eq1Disj;
}, function (dictOrd) {
  return Data_Ord.compare(ordDisj(dictOrd));
});

var boundedDisj = function boundedDisj(dictBounded) {
  return dictBounded;
};

var applyDisj = new Control_Apply.Apply(function () {
  return functorDisj;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindDisj = new Control_Bind.Bind(function () {
  return applyDisj;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeDisj = new Control_Applicative.Applicative(function () {
  return applyDisj;
}, Disj);
var monadDisj = new Control_Monad.Monad(function () {
  return applicativeDisj;
}, function () {
  return bindDisj;
});
module.exports = {
  Disj: Disj,
  eqDisj: eqDisj,
  eq1Disj: eq1Disj,
  ordDisj: ordDisj,
  ord1Disj: ord1Disj,
  boundedDisj: boundedDisj,
  showDisj: showDisj,
  functorDisj: functorDisj,
  applyDisj: applyDisj,
  applicativeDisj: applicativeDisj,
  bindDisj: bindDisj,
  monadDisj: monadDisj,
  semigroupDisj: semigroupDisj,
  monoidDisj: monoidDisj,
  semiringDisj: semiringDisj
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Monoid.Dual/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Dual = function Dual(x) {
  return x;
};

var showDual = function showDual(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Dual " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupDual = function semigroupDual(dictSemigroup) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Data_Semigroup.append(dictSemigroup)(v1)(v);
    };
  });
};

var ordDual = function ordDual(dictOrd) {
  return dictOrd;
};

var monoidDual = function monoidDual(dictMonoid) {
  return new Data_Monoid.Monoid(function () {
    return semigroupDual(dictMonoid.Semigroup0());
  }, Data_Monoid.mempty(dictMonoid));
};

var functorDual = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});

var eqDual = function eqDual(dictEq) {
  return dictEq;
};

var eq1Dual = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqDual(dictEq));
});
var ord1Dual = new Data_Ord.Ord1(function () {
  return eq1Dual;
}, function (dictOrd) {
  return Data_Ord.compare(ordDual(dictOrd));
});

var boundedDual = function boundedDual(dictBounded) {
  return dictBounded;
};

var applyDual = new Control_Apply.Apply(function () {
  return functorDual;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindDual = new Control_Bind.Bind(function () {
  return applyDual;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeDual = new Control_Applicative.Applicative(function () {
  return applyDual;
}, Dual);
var monadDual = new Control_Monad.Monad(function () {
  return applicativeDual;
}, function () {
  return bindDual;
});
module.exports = {
  Dual: Dual,
  eqDual: eqDual,
  eq1Dual: eq1Dual,
  ordDual: ordDual,
  ord1Dual: ord1Dual,
  boundedDual: boundedDual,
  showDual: showDual,
  functorDual: functorDual,
  applyDual: applyDual,
  applicativeDual: applicativeDual,
  bindDual: bindDual,
  monadDual: monadDual,
  semigroupDual: semigroupDual,
  monoidDual: monoidDual
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Monoid.Endo/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Endo = function Endo(x) {
  return x;
};

var showEndo = function showEndo(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Endo " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupEndo = function semigroupEndo(dictSemigroupoid) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Control_Semigroupoid.compose(dictSemigroupoid)(v)(v1);
    };
  });
};

var ordEndo = function ordEndo(dictOrd) {
  return dictOrd;
};

var monoidEndo = function monoidEndo(dictCategory) {
  return new Data_Monoid.Monoid(function () {
    return semigroupEndo(dictCategory.Semigroupoid0());
  }, Control_Category.identity(dictCategory));
};

var eqEndo = function eqEndo(dictEq) {
  return dictEq;
};

var boundedEndo = function boundedEndo(dictBounded) {
  return dictBounded;
};

module.exports = {
  Endo: Endo,
  eqEndo: eqEndo,
  ordEndo: ordEndo,
  boundedEndo: boundedEndo,
  showEndo: showEndo,
  semigroupEndo: semigroupEndo,
  monoidEndo: monoidEndo
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Monoid.Additive/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Additive = function Additive(x) {
  return x;
};

var showAdditive = function showAdditive(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Additive " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupAdditive = function semigroupAdditive(dictSemiring) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Data_Semiring.add(dictSemiring)(v)(v1);
    };
  });
};

var ordAdditive = function ordAdditive(dictOrd) {
  return dictOrd;
};

var monoidAdditive = function monoidAdditive(dictSemiring) {
  return new Data_Monoid.Monoid(function () {
    return semigroupAdditive(dictSemiring);
  }, Data_Semiring.zero(dictSemiring));
};

var functorAdditive = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});

var eqAdditive = function eqAdditive(dictEq) {
  return dictEq;
};

var eq1Additive = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqAdditive(dictEq));
});
var ord1Additive = new Data_Ord.Ord1(function () {
  return eq1Additive;
}, function (dictOrd) {
  return Data_Ord.compare(ordAdditive(dictOrd));
});

var boundedAdditive = function boundedAdditive(dictBounded) {
  return dictBounded;
};

var applyAdditive = new Control_Apply.Apply(function () {
  return functorAdditive;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindAdditive = new Control_Bind.Bind(function () {
  return applyAdditive;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeAdditive = new Control_Applicative.Applicative(function () {
  return applyAdditive;
}, Additive);
var monadAdditive = new Control_Monad.Monad(function () {
  return applicativeAdditive;
}, function () {
  return bindAdditive;
});
module.exports = {
  Additive: Additive,
  eqAdditive: eqAdditive,
  eq1Additive: eq1Additive,
  ordAdditive: ordAdditive,
  ord1Additive: ord1Additive,
  boundedAdditive: boundedAdditive,
  showAdditive: showAdditive,
  functorAdditive: functorAdditive,
  applyAdditive: applyAdditive,
  applicativeAdditive: applicativeAdditive,
  bindAdditive: bindAdditive,
  monadAdditive: monadAdditive,
  semigroupAdditive: semigroupAdditive,
  monoidAdditive: monoidAdditive
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Monoid.Multiplicative/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Multiplicative = function Multiplicative(x) {
  return x;
};

var showMultiplicative = function showMultiplicative(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Multiplicative " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupMultiplicative = function semigroupMultiplicative(dictSemiring) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Data_Semiring.mul(dictSemiring)(v)(v1);
    };
  });
};

var ordMultiplicative = function ordMultiplicative(dictOrd) {
  return dictOrd;
};

var monoidMultiplicative = function monoidMultiplicative(dictSemiring) {
  return new Data_Monoid.Monoid(function () {
    return semigroupMultiplicative(dictSemiring);
  }, Data_Semiring.one(dictSemiring));
};

var functorMultiplicative = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});

var eqMultiplicative = function eqMultiplicative(dictEq) {
  return dictEq;
};

var eq1Multiplicative = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqMultiplicative(dictEq));
});
var ord1Multiplicative = new Data_Ord.Ord1(function () {
  return eq1Multiplicative;
}, function (dictOrd) {
  return Data_Ord.compare(ordMultiplicative(dictOrd));
});

var boundedMultiplicative = function boundedMultiplicative(dictBounded) {
  return dictBounded;
};

var applyMultiplicative = new Control_Apply.Apply(function () {
  return functorMultiplicative;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindMultiplicative = new Control_Bind.Bind(function () {
  return applyMultiplicative;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeMultiplicative = new Control_Applicative.Applicative(function () {
  return applyMultiplicative;
}, Multiplicative);
var monadMultiplicative = new Control_Monad.Monad(function () {
  return applicativeMultiplicative;
}, function () {
  return bindMultiplicative;
});
module.exports = {
  Multiplicative: Multiplicative,
  eqMultiplicative: eqMultiplicative,
  eq1Multiplicative: eq1Multiplicative,
  ordMultiplicative: ordMultiplicative,
  ord1Multiplicative: ord1Multiplicative,
  boundedMultiplicative: boundedMultiplicative,
  showMultiplicative: showMultiplicative,
  functorMultiplicative: functorMultiplicative,
  applyMultiplicative: applyMultiplicative,
  applicativeMultiplicative: applicativeMultiplicative,
  bindMultiplicative: bindMultiplicative,
  monadMultiplicative: monadMultiplicative,
  semigroupMultiplicative: semigroupMultiplicative,
  monoidMultiplicative: monoidMultiplicative
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Semigroup.First/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var First = function First(x) {
  return x;
};

var showFirst = function showFirst(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(First " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupFirst = new Data_Semigroup.Semigroup(function (x) {
  return function (v) {
    return x;
  };
});

var ordFirst = function ordFirst(dictOrd) {
  return dictOrd;
};

var functorFirst = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});

var eqFirst = function eqFirst(dictEq) {
  return dictEq;
};

var eq1First = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqFirst(dictEq));
});
var ord1First = new Data_Ord.Ord1(function () {
  return eq1First;
}, function (dictOrd) {
  return Data_Ord.compare(ordFirst(dictOrd));
});

var boundedFirst = function boundedFirst(dictBounded) {
  return dictBounded;
};

var applyFirst = new Control_Apply.Apply(function () {
  return functorFirst;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindFirst = new Control_Bind.Bind(function () {
  return applyFirst;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeFirst = new Control_Applicative.Applicative(function () {
  return applyFirst;
}, First);
var monadFirst = new Control_Monad.Monad(function () {
  return applicativeFirst;
}, function () {
  return bindFirst;
});
module.exports = {
  First: First,
  eqFirst: eqFirst,
  eq1First: eq1First,
  ordFirst: ordFirst,
  ord1First: ord1First,
  boundedFirst: boundedFirst,
  showFirst: showFirst,
  functorFirst: functorFirst,
  applyFirst: applyFirst,
  applicativeFirst: applicativeFirst,
  bindFirst: bindFirst,
  monadFirst: monadFirst,
  semigroupFirst: semigroupFirst
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Semigroup.Last/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Last = function Last(x) {
  return x;
};

var showLast = function showLast(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Last " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupLast = new Data_Semigroup.Semigroup(function (v) {
  return function (x) {
    return x;
  };
});

var ordLast = function ordLast(dictOrd) {
  return dictOrd;
};

var functorLast = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});

var eqLast = function eqLast(dictEq) {
  return dictEq;
};

var eq1Last = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqLast(dictEq));
});
var ord1Last = new Data_Ord.Ord1(function () {
  return eq1Last;
}, function (dictOrd) {
  return Data_Ord.compare(ordLast(dictOrd));
});

var boundedLast = function boundedLast(dictBounded) {
  return dictBounded;
};

var applyLast = new Control_Apply.Apply(function () {
  return functorLast;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindLast = new Control_Bind.Bind(function () {
  return applyLast;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeLast = new Control_Applicative.Applicative(function () {
  return applyLast;
}, Last);
var monadLast = new Control_Monad.Monad(function () {
  return applicativeLast;
}, function () {
  return bindLast;
});
module.exports = {
  Last: Last,
  eqLast: eqLast,
  eq1Last: eq1Last,
  ordLast: ordLast,
  ord1Last: ord1Last,
  boundedLast: boundedLast,
  showLast: showLast,
  functorLast: functorLast,
  applyLast: applyLast,
  applicativeLast: applicativeLast,
  bindLast: bindLast,
  monadLast: monadLast,
  semigroupLast: semigroupLast
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Newtype/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid_Additive = require("../Data.Monoid.Additive/index.js");

var Data_Monoid_Conj = require("../Data.Monoid.Conj/index.js");

var Data_Monoid_Disj = require("../Data.Monoid.Disj/index.js");

var Data_Monoid_Dual = require("../Data.Monoid.Dual/index.js");

var Data_Monoid_Endo = require("../Data.Monoid.Endo/index.js");

var Data_Monoid_Multiplicative = require("../Data.Monoid.Multiplicative/index.js");

var Data_Semigroup_First = require("../Data.Semigroup.First/index.js");

var Data_Semigroup_Last = require("../Data.Semigroup.Last/index.js");

var Newtype = function Newtype(unwrap, wrap) {
  this.unwrap = unwrap;
  this.wrap = wrap;
};

var wrap = function wrap(dict) {
  return dict.wrap;
};

var unwrap = function unwrap(dict) {
  return dict.unwrap;
};

var underF2 = function underF2(dictFunctor) {
  return function (dictFunctor1) {
    return function (dictNewtype) {
      return function (dictNewtype1) {
        return function (v) {
          return function (f) {
            var $66 = Control_Semigroupoid.compose(Control_Semigroupoid.semigroupoidFn)(Data_Functor.map(dictFunctor1)(unwrap(dictNewtype1)));
            var $67 = Data_Function.on(f)(Data_Functor.map(dictFunctor)(wrap(dictNewtype)));
            return function ($68) {
              return $66($67($68));
            };
          };
        };
      };
    };
  };
};

var underF = function underF(dictFunctor) {
  return function (dictFunctor1) {
    return function (dictNewtype) {
      return function (dictNewtype1) {
        return function (v) {
          return function (f) {
            var $69 = Data_Functor.map(dictFunctor1)(unwrap(dictNewtype1));
            var $70 = Data_Functor.map(dictFunctor)(wrap(dictNewtype));
            return function ($71) {
              return $69(f($70($71)));
            };
          };
        };
      };
    };
  };
};

var under2 = function under2(dictNewtype) {
  return function (dictNewtype1) {
    return function (v) {
      return function (f) {
        var $72 = Control_Semigroupoid.compose(Control_Semigroupoid.semigroupoidFn)(unwrap(dictNewtype1));
        var $73 = Data_Function.on(f)(wrap(dictNewtype));
        return function ($74) {
          return $72($73($74));
        };
      };
    };
  };
};

var under = function under(dictNewtype) {
  return function (dictNewtype1) {
    return function (v) {
      return function (f) {
        var $75 = unwrap(dictNewtype1);
        var $76 = wrap(dictNewtype);
        return function ($77) {
          return $75(f($76($77)));
        };
      };
    };
  };
};

var un = function un(dictNewtype) {
  return function (v) {
    return unwrap(dictNewtype);
  };
};

var traverse = function traverse(dictFunctor) {
  return function (dictNewtype) {
    return function (v) {
      return function (f) {
        var $78 = Data_Functor.map(dictFunctor)(wrap(dictNewtype));
        var $79 = unwrap(dictNewtype);
        return function ($80) {
          return $78(f($79($80)));
        };
      };
    };
  };
};

var overF2 = function overF2(dictFunctor) {
  return function (dictFunctor1) {
    return function (dictNewtype) {
      return function (dictNewtype1) {
        return function (v) {
          return function (f) {
            var $81 = Control_Semigroupoid.compose(Control_Semigroupoid.semigroupoidFn)(Data_Functor.map(dictFunctor1)(wrap(dictNewtype1)));
            var $82 = Data_Function.on(f)(Data_Functor.map(dictFunctor)(unwrap(dictNewtype)));
            return function ($83) {
              return $81($82($83));
            };
          };
        };
      };
    };
  };
};

var overF = function overF(dictFunctor) {
  return function (dictFunctor1) {
    return function (dictNewtype) {
      return function (dictNewtype1) {
        return function (v) {
          return function (f) {
            var $84 = Data_Functor.map(dictFunctor1)(wrap(dictNewtype1));
            var $85 = Data_Functor.map(dictFunctor)(unwrap(dictNewtype));
            return function ($86) {
              return $84(f($85($86)));
            };
          };
        };
      };
    };
  };
};

var over2 = function over2(dictNewtype) {
  return function (dictNewtype1) {
    return function (v) {
      return function (f) {
        var $87 = Control_Semigroupoid.compose(Control_Semigroupoid.semigroupoidFn)(wrap(dictNewtype1));
        var $88 = Data_Function.on(f)(unwrap(dictNewtype));
        return function ($89) {
          return $87($88($89));
        };
      };
    };
  };
};

var over = function over(dictNewtype) {
  return function (dictNewtype1) {
    return function (v) {
      return function (f) {
        var $90 = wrap(dictNewtype1);
        var $91 = unwrap(dictNewtype);
        return function ($92) {
          return $90(f($91($92)));
        };
      };
    };
  };
};

var op = function op(dictNewtype) {
  return un(dictNewtype);
};

var newtypeMultiplicative = new Newtype(function (v) {
  return v;
}, Data_Monoid_Multiplicative.Multiplicative);
var newtypeLast = new Newtype(function (v) {
  return v;
}, Data_Semigroup_Last.Last);
var newtypeFirst = new Newtype(function (v) {
  return v;
}, Data_Semigroup_First.First);
var newtypeEndo = new Newtype(function (v) {
  return v;
}, Data_Monoid_Endo.Endo);
var newtypeDual = new Newtype(function (v) {
  return v;
}, Data_Monoid_Dual.Dual);
var newtypeDisj = new Newtype(function (v) {
  return v;
}, Data_Monoid_Disj.Disj);
var newtypeConj = new Newtype(function (v) {
  return v;
}, Data_Monoid_Conj.Conj);
var newtypeAdditive = new Newtype(function (v) {
  return v;
}, Data_Monoid_Additive.Additive);

var collect = function collect(dictFunctor) {
  return function (dictNewtype) {
    return function (v) {
      return function (f) {
        var $93 = wrap(dictNewtype);
        var $94 = Data_Functor.map(dictFunctor)(unwrap(dictNewtype));
        return function ($95) {
          return $93(f($94($95)));
        };
      };
    };
  };
};

var alaF = function alaF(dictFunctor) {
  return function (dictFunctor1) {
    return function (dictNewtype) {
      return function (dictNewtype1) {
        return function (v) {
          return function (f) {
            var $96 = Data_Functor.map(dictFunctor1)(unwrap(dictNewtype1));
            var $97 = Data_Functor.map(dictFunctor)(wrap(dictNewtype));
            return function ($98) {
              return $96(f($97($98)));
            };
          };
        };
      };
    };
  };
};

var ala = function ala(dictFunctor) {
  return function (dictNewtype) {
    return function (dictNewtype1) {
      return function (v) {
        return function (f) {
          return Data_Functor.map(dictFunctor)(unwrap(dictNewtype))(f(wrap(dictNewtype1)));
        };
      };
    };
  };
};

module.exports = {
  unwrap: unwrap,
  wrap: wrap,
  Newtype: Newtype,
  un: un,
  op: op,
  ala: ala,
  alaF: alaF,
  over: over,
  overF: overF,
  under: under,
  underF: underF,
  over2: over2,
  overF2: overF2,
  under2: under2,
  underF2: underF2,
  traverse: traverse,
  collect: collect,
  newtypeAdditive: newtypeAdditive,
  newtypeMultiplicative: newtypeMultiplicative,
  newtypeConj: newtypeConj,
  newtypeDisj: newtypeDisj,
  newtypeDual: newtypeDual,
  newtypeEndo: newtypeEndo,
  newtypeFirst: newtypeFirst,
  newtypeLast: newtypeLast
};
},{"../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid.Additive/index.js":"../output/Data.Monoid.Additive/index.js","../Data.Monoid.Conj/index.js":"../output/Data.Monoid.Conj/index.js","../Data.Monoid.Disj/index.js":"../output/Data.Monoid.Disj/index.js","../Data.Monoid.Dual/index.js":"../output/Data.Monoid.Dual/index.js","../Data.Monoid.Endo/index.js":"../output/Data.Monoid.Endo/index.js","../Data.Monoid.Multiplicative/index.js":"../output/Data.Monoid.Multiplicative/index.js","../Data.Semigroup.First/index.js":"../output/Data.Semigroup.First/index.js","../Data.Semigroup.Last/index.js":"../output/Data.Semigroup.Last/index.js"}],"../output/Data.Foldable/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Monoid_Conj = require("../Data.Monoid.Conj/index.js");

var Data_Monoid_Disj = require("../Data.Monoid.Disj/index.js");

var Data_Monoid_Dual = require("../Data.Monoid.Dual/index.js");

var Data_Monoid_Endo = require("../Data.Monoid.Endo/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Foldable = function Foldable(foldMap, foldl, foldr) {
  this.foldMap = foldMap;
  this.foldl = foldl;
  this.foldr = foldr;
};

var foldr = function foldr(dict) {
  return dict.foldr;
};

var indexr = function indexr(dictFoldable) {
  return function (idx) {
    var go = function go(a) {
      return function (cursor) {
        if (cursor.elem instanceof Data_Maybe.Just) {
          return cursor;
        }

        ;
        var $106 = cursor.pos === idx;

        if ($106) {
          return {
            elem: new Data_Maybe.Just(a),
            pos: cursor.pos
          };
        }

        ;
        return {
          pos: cursor.pos + 1 | 0,
          elem: cursor.elem
        };
      };
    };

    var $193 = foldr(dictFoldable)(go)({
      elem: Data_Maybe.Nothing.value,
      pos: 0
    });
    return function ($194) {
      return function (v) {
        return v.elem;
      }($193($194));
    };
  };
};

var $$null = function $$null(dictFoldable) {
  return foldr(dictFoldable)(function (v) {
    return function (v1) {
      return false;
    };
  })(true);
};

var oneOf = function oneOf(dictFoldable) {
  return function (dictPlus) {
    return foldr(dictFoldable)(Control_Alt.alt(dictPlus.Alt0()))(Control_Plus.empty(dictPlus));
  };
};

var oneOfMap = function oneOfMap(dictFoldable) {
  return function (dictPlus) {
    return function (f) {
      return foldr(dictFoldable)(function () {
        var $195 = Control_Alt.alt(dictPlus.Alt0());
        return function ($196) {
          return $195(f($196));
        };
      }())(Control_Plus.empty(dictPlus));
    };
  };
};

var traverse_ = function traverse_(dictApplicative) {
  return function (dictFoldable) {
    return function (f) {
      return foldr(dictFoldable)(function () {
        var $197 = Control_Apply.applySecond(dictApplicative.Apply0());
        return function ($198) {
          return $197(f($198));
        };
      }())(Control_Applicative.pure(dictApplicative)(Data_Unit.unit));
    };
  };
};

var for_ = function for_(dictApplicative) {
  return function (dictFoldable) {
    return Data_Function.flip(traverse_(dictApplicative)(dictFoldable));
  };
};

var sequence_ = function sequence_(dictApplicative) {
  return function (dictFoldable) {
    return traverse_(dictApplicative)(dictFoldable)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var foldl = function foldl(dict) {
  return dict.foldl;
};

var indexl = function indexl(dictFoldable) {
  return function (idx) {
    var go = function go(cursor) {
      return function (a) {
        if (cursor.elem instanceof Data_Maybe.Just) {
          return cursor;
        }

        ;
        var $109 = cursor.pos === idx;

        if ($109) {
          return {
            elem: new Data_Maybe.Just(a),
            pos: cursor.pos
          };
        }

        ;
        return {
          pos: cursor.pos + 1 | 0,
          elem: cursor.elem
        };
      };
    };

    var $199 = foldl(dictFoldable)(go)({
      elem: Data_Maybe.Nothing.value,
      pos: 0
    });
    return function ($200) {
      return function (v) {
        return v.elem;
      }($199($200));
    };
  };
};

var intercalate = function intercalate(dictFoldable) {
  return function (dictMonoid) {
    return function (sep) {
      return function (xs) {
        var go = function go(v) {
          return function (x) {
            if (v.init) {
              return {
                init: false,
                acc: x
              };
            }

            ;
            return {
              init: false,
              acc: Data_Semigroup.append(dictMonoid.Semigroup0())(v.acc)(Data_Semigroup.append(dictMonoid.Semigroup0())(sep)(x))
            };
          };
        };

        return foldl(dictFoldable)(go)({
          init: true,
          acc: Data_Monoid.mempty(dictMonoid)
        })(xs).acc;
      };
    };
  };
};

var length = function length(dictFoldable) {
  return function (dictSemiring) {
    return foldl(dictFoldable)(function (c) {
      return function (v) {
        return Data_Semiring.add(dictSemiring)(Data_Semiring.one(dictSemiring))(c);
      };
    })(Data_Semiring.zero(dictSemiring));
  };
};

var maximumBy = function maximumBy(dictFoldable) {
  return function (cmp) {
    var max$prime = function max$prime(v) {
      return function (v1) {
        if (v instanceof Data_Maybe.Nothing) {
          return new Data_Maybe.Just(v1);
        }

        ;

        if (v instanceof Data_Maybe.Just) {
          return new Data_Maybe.Just(function () {
            var $116 = Data_Eq.eq(Data_Ordering.eqOrdering)(cmp(v.value0)(v1))(Data_Ordering.GT.value);

            if ($116) {
              return v.value0;
            }

            ;
            return v1;
          }());
        }

        ;
        throw new Error("Failed pattern match at Data.Foldable (line 389, column 3 - line 389, column 27): " + [v.constructor.name, v1.constructor.name]);
      };
    };

    return foldl(dictFoldable)(max$prime)(Data_Maybe.Nothing.value);
  };
};

var maximum = function maximum(dictOrd) {
  return function (dictFoldable) {
    return maximumBy(dictFoldable)(Data_Ord.compare(dictOrd));
  };
};

var minimumBy = function minimumBy(dictFoldable) {
  return function (cmp) {
    var min$prime = function min$prime(v) {
      return function (v1) {
        if (v instanceof Data_Maybe.Nothing) {
          return new Data_Maybe.Just(v1);
        }

        ;

        if (v instanceof Data_Maybe.Just) {
          return new Data_Maybe.Just(function () {
            var $120 = Data_Eq.eq(Data_Ordering.eqOrdering)(cmp(v.value0)(v1))(Data_Ordering.LT.value);

            if ($120) {
              return v.value0;
            }

            ;
            return v1;
          }());
        }

        ;
        throw new Error("Failed pattern match at Data.Foldable (line 402, column 3 - line 402, column 27): " + [v.constructor.name, v1.constructor.name]);
      };
    };

    return foldl(dictFoldable)(min$prime)(Data_Maybe.Nothing.value);
  };
};

var minimum = function minimum(dictOrd) {
  return function (dictFoldable) {
    return minimumBy(dictFoldable)(Data_Ord.compare(dictOrd));
  };
};

var product = function product(dictFoldable) {
  return function (dictSemiring) {
    return foldl(dictFoldable)(Data_Semiring.mul(dictSemiring))(Data_Semiring.one(dictSemiring));
  };
};

var sum = function sum(dictFoldable) {
  return function (dictSemiring) {
    return foldl(dictFoldable)(Data_Semiring.add(dictSemiring))(Data_Semiring.zero(dictSemiring));
  };
};

var foldableMultiplicative = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(v)(z);
    };
  };
});
var foldableMaybe = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      if (v instanceof Data_Maybe.Nothing) {
        return Data_Monoid.mempty(dictMonoid);
      }

      ;

      if (v instanceof Data_Maybe.Just) {
        return f(v.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Foldable (line 129, column 1 - line 135, column 27): " + [f.constructor.name, v.constructor.name]);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      if (v1 instanceof Data_Maybe.Nothing) {
        return z;
      }

      ;

      if (v1 instanceof Data_Maybe.Just) {
        return v(z)(v1.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Foldable (line 129, column 1 - line 135, column 27): " + [v.constructor.name, z.constructor.name, v1.constructor.name]);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      if (v1 instanceof Data_Maybe.Nothing) {
        return z;
      }

      ;

      if (v1 instanceof Data_Maybe.Just) {
        return v(v1.value0)(z);
      }

      ;
      throw new Error("Failed pattern match at Data.Foldable (line 129, column 1 - line 135, column 27): " + [v.constructor.name, z.constructor.name, v1.constructor.name]);
    };
  };
});
var foldableDual = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(v)(z);
    };
  };
});
var foldableDisj = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(v)(z);
    };
  };
});
var foldableConj = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(v)(z);
    };
  };
});
var foldableAdditive = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(v)(z);
    };
  };
});

var foldMapDefaultR = function foldMapDefaultR(dictFoldable) {
  return function (dictMonoid) {
    return function (f) {
      return foldr(dictFoldable)(function (x) {
        return function (acc) {
          return Data_Semigroup.append(dictMonoid.Semigroup0())(f(x))(acc);
        };
      })(Data_Monoid.mempty(dictMonoid));
    };
  };
};

var foldableArray = new Foldable(function (dictMonoid) {
  return foldMapDefaultR(foldableArray)(dictMonoid);
}, $foreign.foldlArray, $foreign.foldrArray);

var foldMapDefaultL = function foldMapDefaultL(dictFoldable) {
  return function (dictMonoid) {
    return function (f) {
      return foldl(dictFoldable)(function (acc) {
        return function (x) {
          return Data_Semigroup.append(dictMonoid.Semigroup0())(acc)(f(x));
        };
      })(Data_Monoid.mempty(dictMonoid));
    };
  };
};

var foldMap = function foldMap(dict) {
  return dict.foldMap;
};

var foldableFirst = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return foldMap(foldableMaybe)(dictMonoid)(f)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return foldl(foldableMaybe)(f)(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return foldr(foldableMaybe)(f)(z)(v);
    };
  };
});
var foldableLast = new Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return foldMap(foldableMaybe)(dictMonoid)(f)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return foldl(foldableMaybe)(f)(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return foldr(foldableMaybe)(f)(z)(v);
    };
  };
});

var foldlDefault = function foldlDefault(dictFoldable) {
  return function (c) {
    return function (u) {
      return function (xs) {
        return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(Data_Newtype.unwrap(Data_Newtype.newtypeDual)(foldMap(dictFoldable)(Data_Monoid_Dual.monoidDual(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn)))(function () {
          var $201 = Data_Function.flip(c);
          return function ($202) {
            return Data_Monoid_Dual.Dual(Data_Monoid_Endo.Endo($201($202)));
          };
        }())(xs)))(u);
      };
    };
  };
};

var foldrDefault = function foldrDefault(dictFoldable) {
  return function (c) {
    return function (u) {
      return function (xs) {
        return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(foldMap(dictFoldable)(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn))(function ($203) {
          return Data_Monoid_Endo.Endo(c($203));
        })(xs))(u);
      };
    };
  };
};

var surroundMap = function surroundMap(dictFoldable) {
  return function (dictSemigroup) {
    return function (d) {
      return function (t) {
        return function (f) {
          var joined = function joined(a) {
            return function (m) {
              return Data_Semigroup.append(dictSemigroup)(d)(Data_Semigroup.append(dictSemigroup)(t(a))(m));
            };
          };

          return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(foldMap(dictFoldable)(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn))(joined)(f))(d);
        };
      };
    };
  };
};

var surround = function surround(dictFoldable) {
  return function (dictSemigroup) {
    return function (d) {
      return surroundMap(dictFoldable)(dictSemigroup)(d)(Control_Category.identity(Control_Category.categoryFn));
    };
  };
};

var foldM = function foldM(dictFoldable) {
  return function (dictMonad) {
    return function (f) {
      return function (a0) {
        return foldl(dictFoldable)(function (ma) {
          return function (b) {
            return Control_Bind.bind(dictMonad.Bind1())(ma)(Data_Function.flip(f)(b));
          };
        })(Control_Applicative.pure(dictMonad.Applicative0())(a0));
      };
    };
  };
};

var fold = function fold(dictFoldable) {
  return function (dictMonoid) {
    return foldMap(dictFoldable)(dictMonoid)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var findMap = function findMap(dictFoldable) {
  return function (p) {
    var go = function go(v) {
      return function (v1) {
        if (v instanceof Data_Maybe.Nothing) {
          return p(v1);
        }

        ;
        return v;
      };
    };

    return foldl(dictFoldable)(go)(Data_Maybe.Nothing.value);
  };
};

var find = function find(dictFoldable) {
  return function (p) {
    var go = function go(v) {
      return function (v1) {
        if (v instanceof Data_Maybe.Nothing && p(v1)) {
          return new Data_Maybe.Just(v1);
        }

        ;
        return v;
      };
    };

    return foldl(dictFoldable)(go)(Data_Maybe.Nothing.value);
  };
};

var any = function any(dictFoldable) {
  return function (dictHeytingAlgebra) {
    return Data_Newtype.alaF(Data_Functor.functorFn)(Data_Functor.functorFn)(Data_Newtype.newtypeDisj)(Data_Newtype.newtypeDisj)(Data_Monoid_Disj.Disj)(foldMap(dictFoldable)(Data_Monoid_Disj.monoidDisj(dictHeytingAlgebra)));
  };
};

var elem = function elem(dictFoldable) {
  return function (dictEq) {
    var $204 = any(dictFoldable)(Data_HeytingAlgebra.heytingAlgebraBoolean);
    var $205 = Data_Eq.eq(dictEq);
    return function ($206) {
      return $204($205($206));
    };
  };
};

var notElem = function notElem(dictFoldable) {
  return function (dictEq) {
    return function (x) {
      var $207 = Data_HeytingAlgebra.not(Data_HeytingAlgebra.heytingAlgebraBoolean);
      var $208 = elem(dictFoldable)(dictEq)(x);
      return function ($209) {
        return $207($208($209));
      };
    };
  };
};

var or = function or(dictFoldable) {
  return function (dictHeytingAlgebra) {
    return any(dictFoldable)(dictHeytingAlgebra)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var all = function all(dictFoldable) {
  return function (dictHeytingAlgebra) {
    return Data_Newtype.alaF(Data_Functor.functorFn)(Data_Functor.functorFn)(Data_Newtype.newtypeConj)(Data_Newtype.newtypeConj)(Data_Monoid_Conj.Conj)(foldMap(dictFoldable)(Data_Monoid_Conj.monoidConj(dictHeytingAlgebra)));
  };
};

var and = function and(dictFoldable) {
  return function (dictHeytingAlgebra) {
    return all(dictFoldable)(dictHeytingAlgebra)(Control_Category.identity(Control_Category.categoryFn));
  };
};

module.exports = {
  Foldable: Foldable,
  foldr: foldr,
  foldl: foldl,
  foldMap: foldMap,
  foldrDefault: foldrDefault,
  foldlDefault: foldlDefault,
  foldMapDefaultL: foldMapDefaultL,
  foldMapDefaultR: foldMapDefaultR,
  fold: fold,
  foldM: foldM,
  traverse_: traverse_,
  for_: for_,
  sequence_: sequence_,
  oneOf: oneOf,
  oneOfMap: oneOfMap,
  intercalate: intercalate,
  surroundMap: surroundMap,
  surround: surround,
  and: and,
  or: or,
  all: all,
  any: any,
  sum: sum,
  product: product,
  elem: elem,
  notElem: notElem,
  indexl: indexl,
  indexr: indexr,
  find: find,
  findMap: findMap,
  maximum: maximum,
  maximumBy: maximumBy,
  minimum: minimum,
  minimumBy: minimumBy,
  "null": $$null,
  length: length,
  foldableArray: foldableArray,
  foldableMaybe: foldableMaybe,
  foldableFirst: foldableFirst,
  foldableLast: foldableLast,
  foldableAdditive: foldableAdditive,
  foldableDual: foldableDual,
  foldableDisj: foldableDisj,
  foldableConj: foldableConj,
  foldableMultiplicative: foldableMultiplicative
};
},{"./foreign.js":"../output/Data.Foldable/foreign.js","../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Monoid.Conj/index.js":"../output/Data.Monoid.Conj/index.js","../Data.Monoid.Disj/index.js":"../output/Data.Monoid.Disj/index.js","../Data.Monoid.Dual/index.js":"../output/Data.Monoid.Dual/index.js","../Data.Monoid.Endo/index.js":"../output/Data.Monoid.Endo/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Bifoldable/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Monoid_Conj = require("../Data.Monoid.Conj/index.js");

var Data_Monoid_Disj = require("../Data.Monoid.Disj/index.js");

var Data_Monoid_Dual = require("../Data.Monoid.Dual/index.js");

var Data_Monoid_Endo = require("../Data.Monoid.Endo/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Bifoldable = function Bifoldable(bifoldMap, bifoldl, bifoldr) {
  this.bifoldMap = bifoldMap;
  this.bifoldl = bifoldl;
  this.bifoldr = bifoldr;
};

var bifoldr = function bifoldr(dict) {
  return dict.bifoldr;
};

var bitraverse_ = function bitraverse_(dictBifoldable) {
  return function (dictApplicative) {
    return function (f) {
      return function (g) {
        return bifoldr(dictBifoldable)(function () {
          var $97 = Control_Apply.applySecond(dictApplicative.Apply0());
          return function ($98) {
            return $97(f($98));
          };
        }())(function () {
          var $99 = Control_Apply.applySecond(dictApplicative.Apply0());
          return function ($100) {
            return $99(g($100));
          };
        }())(Control_Applicative.pure(dictApplicative)(Data_Unit.unit));
      };
    };
  };
};

var bifor_ = function bifor_(dictBifoldable) {
  return function (dictApplicative) {
    return function (t) {
      return function (f) {
        return function (g) {
          return bitraverse_(dictBifoldable)(dictApplicative)(f)(g)(t);
        };
      };
    };
  };
};

var bisequence_ = function bisequence_(dictBifoldable) {
  return function (dictApplicative) {
    return bitraverse_(dictBifoldable)(dictApplicative)(Control_Category.identity(Control_Category.categoryFn))(Control_Category.identity(Control_Category.categoryFn));
  };
};

var bifoldl = function bifoldl(dict) {
  return dict.bifoldl;
};

var bifoldableJoker = function bifoldableJoker(dictFoldable) {
  return new Bifoldable(function (dictMonoid) {
    return function (v) {
      return function (r) {
        return function (v1) {
          return Data_Foldable.foldMap(dictFoldable)(dictMonoid)(r)(v1);
        };
      };
    };
  }, function (v) {
    return function (r) {
      return function (u) {
        return function (v1) {
          return Data_Foldable.foldl(dictFoldable)(r)(u)(v1);
        };
      };
    };
  }, function (v) {
    return function (r) {
      return function (u) {
        return function (v1) {
          return Data_Foldable.foldr(dictFoldable)(r)(u)(v1);
        };
      };
    };
  });
};

var bifoldableClown = function bifoldableClown(dictFoldable) {
  return new Bifoldable(function (dictMonoid) {
    return function (l) {
      return function (v) {
        return function (v1) {
          return Data_Foldable.foldMap(dictFoldable)(dictMonoid)(l)(v1);
        };
      };
    };
  }, function (l) {
    return function (v) {
      return function (u) {
        return function (v1) {
          return Data_Foldable.foldl(dictFoldable)(l)(u)(v1);
        };
      };
    };
  }, function (l) {
    return function (v) {
      return function (u) {
        return function (v1) {
          return Data_Foldable.foldr(dictFoldable)(l)(u)(v1);
        };
      };
    };
  });
};

var bifoldMapDefaultR = function bifoldMapDefaultR(dictBifoldable) {
  return function (dictMonoid) {
    return function (f) {
      return function (g) {
        return bifoldr(dictBifoldable)(function () {
          var $101 = Data_Semigroup.append(dictMonoid.Semigroup0());
          return function ($102) {
            return $101(f($102));
          };
        }())(function () {
          var $103 = Data_Semigroup.append(dictMonoid.Semigroup0());
          return function ($104) {
            return $103(g($104));
          };
        }())(Data_Monoid.mempty(dictMonoid));
      };
    };
  };
};

var bifoldMapDefaultL = function bifoldMapDefaultL(dictBifoldable) {
  return function (dictMonoid) {
    return function (f) {
      return function (g) {
        return bifoldl(dictBifoldable)(function (m) {
          return function (a) {
            return Data_Semigroup.append(dictMonoid.Semigroup0())(m)(f(a));
          };
        })(function (m) {
          return function (b) {
            return Data_Semigroup.append(dictMonoid.Semigroup0())(m)(g(b));
          };
        })(Data_Monoid.mempty(dictMonoid));
      };
    };
  };
};

var bifoldMap = function bifoldMap(dict) {
  return dict.bifoldMap;
};

var bifoldableFlip = function bifoldableFlip(dictBifoldable) {
  return new Bifoldable(function (dictMonoid) {
    return function (r) {
      return function (l) {
        return function (v) {
          return bifoldMap(dictBifoldable)(dictMonoid)(l)(r)(v);
        };
      };
    };
  }, function (r) {
    return function (l) {
      return function (u) {
        return function (v) {
          return bifoldl(dictBifoldable)(l)(r)(u)(v);
        };
      };
    };
  }, function (r) {
    return function (l) {
      return function (u) {
        return function (v) {
          return bifoldr(dictBifoldable)(l)(r)(u)(v);
        };
      };
    };
  });
};

var bifoldableWrap = function bifoldableWrap(dictBifoldable) {
  return new Bifoldable(function (dictMonoid) {
    return function (l) {
      return function (r) {
        return function (v) {
          return bifoldMap(dictBifoldable)(dictMonoid)(l)(r)(v);
        };
      };
    };
  }, function (l) {
    return function (r) {
      return function (u) {
        return function (v) {
          return bifoldl(dictBifoldable)(l)(r)(u)(v);
        };
      };
    };
  }, function (l) {
    return function (r) {
      return function (u) {
        return function (v) {
          return bifoldr(dictBifoldable)(l)(r)(u)(v);
        };
      };
    };
  });
};

var bifoldlDefault = function bifoldlDefault(dictBifoldable) {
  return function (f) {
    return function (g) {
      return function (z) {
        return function (p) {
          return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(Data_Newtype.unwrap(Data_Newtype.newtypeDual)(bifoldMap(dictBifoldable)(Data_Monoid_Dual.monoidDual(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn)))(function () {
            var $105 = Data_Function.flip(f);
            return function ($106) {
              return Data_Monoid_Dual.Dual(Data_Monoid_Endo.Endo($105($106)));
            };
          }())(function () {
            var $107 = Data_Function.flip(g);
            return function ($108) {
              return Data_Monoid_Dual.Dual(Data_Monoid_Endo.Endo($107($108)));
            };
          }())(p)))(z);
        };
      };
    };
  };
};

var bifoldrDefault = function bifoldrDefault(dictBifoldable) {
  return function (f) {
    return function (g) {
      return function (z) {
        return function (p) {
          return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(bifoldMap(dictBifoldable)(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn))(function ($109) {
            return Data_Monoid_Endo.Endo(f($109));
          })(function ($110) {
            return Data_Monoid_Endo.Endo(g($110));
          })(p))(z);
        };
      };
    };
  };
};

var bifoldableProduct = function bifoldableProduct(dictBifoldable) {
  return function (dictBifoldable1) {
    return new Bifoldable(function (dictMonoid) {
      return function (l) {
        return function (r) {
          return function (v) {
            return Data_Semigroup.append(dictMonoid.Semigroup0())(bifoldMap(dictBifoldable)(dictMonoid)(l)(r)(v.value0))(bifoldMap(dictBifoldable1)(dictMonoid)(l)(r)(v.value1));
          };
        };
      };
    }, function (l) {
      return function (r) {
        return function (u) {
          return function (m) {
            return bifoldlDefault(bifoldableProduct(dictBifoldable)(dictBifoldable1))(l)(r)(u)(m);
          };
        };
      };
    }, function (l) {
      return function (r) {
        return function (u) {
          return function (m) {
            return bifoldrDefault(bifoldableProduct(dictBifoldable)(dictBifoldable1))(l)(r)(u)(m);
          };
        };
      };
    });
  };
};

var bifold = function bifold(dictBifoldable) {
  return function (dictMonoid) {
    return bifoldMap(dictBifoldable)(dictMonoid)(Control_Category.identity(Control_Category.categoryFn))(Control_Category.identity(Control_Category.categoryFn));
  };
};

var biany = function biany(dictBifoldable) {
  return function (dictBooleanAlgebra) {
    return function (p) {
      return function (q) {
        var $111 = Data_Newtype.unwrap(Data_Newtype.newtypeDisj);
        var $112 = bifoldMap(dictBifoldable)(Data_Monoid_Disj.monoidDisj(dictBooleanAlgebra.HeytingAlgebra0()))(function ($114) {
          return Data_Monoid_Disj.Disj(p($114));
        })(function ($115) {
          return Data_Monoid_Disj.Disj(q($115));
        });
        return function ($113) {
          return $111($112($113));
        };
      };
    };
  };
};

var biall = function biall(dictBifoldable) {
  return function (dictBooleanAlgebra) {
    return function (p) {
      return function (q) {
        var $116 = Data_Newtype.unwrap(Data_Newtype.newtypeConj);
        var $117 = bifoldMap(dictBifoldable)(Data_Monoid_Conj.monoidConj(dictBooleanAlgebra.HeytingAlgebra0()))(function ($119) {
          return Data_Monoid_Conj.Conj(p($119));
        })(function ($120) {
          return Data_Monoid_Conj.Conj(q($120));
        });
        return function ($118) {
          return $116($117($118));
        };
      };
    };
  };
};

module.exports = {
  bifoldMap: bifoldMap,
  bifoldl: bifoldl,
  bifoldr: bifoldr,
  Bifoldable: Bifoldable,
  bifoldrDefault: bifoldrDefault,
  bifoldlDefault: bifoldlDefault,
  bifoldMapDefaultR: bifoldMapDefaultR,
  bifoldMapDefaultL: bifoldMapDefaultL,
  bifold: bifold,
  bitraverse_: bitraverse_,
  bifor_: bifor_,
  bisequence_: bisequence_,
  biany: biany,
  biall: biall,
  bifoldableClown: bifoldableClown,
  bifoldableJoker: bifoldableJoker,
  bifoldableFlip: bifoldableFlip,
  bifoldableProduct: bifoldableProduct,
  bifoldableWrap: bifoldableWrap
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Monoid.Conj/index.js":"../output/Data.Monoid.Conj/index.js","../Data.Monoid.Disj/index.js":"../output/Data.Monoid.Disj/index.js","../Data.Monoid.Dual/index.js":"../output/Data.Monoid.Dual/index.js","../Data.Monoid.Endo/index.js":"../output/Data.Monoid.Endo/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Bifunctor/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Bifunctor = function Bifunctor(bimap) {
  this.bimap = bimap;
};

var bimap = function bimap(dict) {
  return dict.bimap;
};

var lmap = function lmap(dictBifunctor) {
  return function (f) {
    return bimap(dictBifunctor)(f)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var rmap = function rmap(dictBifunctor) {
  return bimap(dictBifunctor)(Control_Category.identity(Control_Category.categoryFn));
};

module.exports = {
  bimap: bimap,
  Bifunctor: Bifunctor,
  lmap: lmap,
  rmap: rmap
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js"}],"../output/Control.Biapplicative/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Biapplicative = function Biapplicative(Biapply0, bipure) {
  this.Biapply0 = Biapply0;
  this.bipure = bipure;
};

var bipure = function bipure(dict) {
  return dict.bipure;
};

module.exports = {
  bipure: bipure,
  Biapplicative: Biapplicative
};
},{}],"../output/Control.Biapply/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Function = require("../Data.Function/index.js");

var Biapply = function Biapply(Bifunctor0, biapply) {
  this.Bifunctor0 = Bifunctor0;
  this.biapply = biapply;
};

var biapply = function biapply(dict) {
  return dict.biapply;
};

var biapplyFirst = function biapplyFirst(dictBiapply) {
  return function (a) {
    return function (b) {
      return biapply(dictBiapply)(Control_Category.identity(Control_Category.categoryFn)(Data_Bifunctor.bimap(dictBiapply.Bifunctor0())(Data_Function["const"](Control_Category.identity(Control_Category.categoryFn)))(Data_Function["const"](Control_Category.identity(Control_Category.categoryFn))))(a))(b);
    };
  };
};

var biapplySecond = function biapplySecond(dictBiapply) {
  return function (a) {
    return function (b) {
      return biapply(dictBiapply)(Control_Category.identity(Control_Category.categoryFn)(Data_Bifunctor.bimap(dictBiapply.Bifunctor0())(Data_Function["const"])(Data_Function["const"]))(a))(b);
    };
  };
};

var bilift2 = function bilift2(dictBiapply) {
  return function (f) {
    return function (g) {
      return function (a) {
        return function (b) {
          return biapply(dictBiapply)(Control_Category.identity(Control_Category.categoryFn)(Data_Bifunctor.bimap(dictBiapply.Bifunctor0())(f)(g))(a))(b);
        };
      };
    };
  };
};

var bilift3 = function bilift3(dictBiapply) {
  return function (f) {
    return function (g) {
      return function (a) {
        return function (b) {
          return function (c) {
            return biapply(dictBiapply)(biapply(dictBiapply)(Control_Category.identity(Control_Category.categoryFn)(Data_Bifunctor.bimap(dictBiapply.Bifunctor0())(f)(g))(a))(b))(c);
          };
        };
      };
    };
  };
};

module.exports = {
  biapply: biapply,
  Biapply: Biapply,
  biapplyFirst: biapplyFirst,
  biapplySecond: biapplySecond,
  bilift2: bilift2,
  bilift3: bilift3
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Function/index.js":"../output/Data.Function/index.js"}],"../output/Data.Bifunctor.Clown/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Biapplicative = require("../Control.Biapplicative/index.js");

var Control_Biapply = require("../Control.Biapply/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Show = require("../Data.Show/index.js");

var Clown = function Clown(x) {
  return x;
};

var showClown = function showClown(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Clown " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var ordClown = function ordClown(dictOrd) {
  return dictOrd;
};

var newtypeClown = new Data_Newtype.Newtype(function (n) {
  return n;
}, Clown);
var functorClown = new Data_Functor.Functor(function (v) {
  return function (v1) {
    return v1;
  };
});

var eqClown = function eqClown(dictEq) {
  return dictEq;
};

var bifunctorClown = function bifunctorClown(dictFunctor) {
  return new Data_Bifunctor.Bifunctor(function (f) {
    return function (v) {
      return function (v1) {
        return Data_Functor.map(dictFunctor)(f)(v1);
      };
    };
  });
};

var biapplyClown = function biapplyClown(dictApply) {
  return new Control_Biapply.Biapply(function () {
    return bifunctorClown(dictApply.Functor0());
  }, function (v) {
    return function (v1) {
      return Control_Apply.apply(dictApply)(v)(v1);
    };
  });
};

var biapplicativeClown = function biapplicativeClown(dictApplicative) {
  return new Control_Biapplicative.Biapplicative(function () {
    return biapplyClown(dictApplicative.Apply0());
  }, function (a) {
    return function (v) {
      return Control_Applicative.pure(dictApplicative)(a);
    };
  });
};

module.exports = {
  Clown: Clown,
  newtypeClown: newtypeClown,
  eqClown: eqClown,
  ordClown: ordClown,
  showClown: showClown,
  functorClown: functorClown,
  bifunctorClown: bifunctorClown,
  biapplyClown: biapplyClown,
  biapplicativeClown: biapplicativeClown
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Biapplicative/index.js":"../output/Control.Biapplicative/index.js","../Control.Biapply/index.js":"../output/Control.Biapply/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Bifunctor.Flip/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Biapplicative = require("../Control.Biapplicative/index.js");

var Control_Biapply = require("../Control.Biapply/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Show = require("../Data.Show/index.js");

var Flip = function Flip(x) {
  return x;
};

var showFlip = function showFlip(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Flip " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var ordFlip = function ordFlip(dictOrd) {
  return dictOrd;
};

var newtypeFlip = new Data_Newtype.Newtype(function (n) {
  return n;
}, Flip);

var functorFlip = function functorFlip(dictBifunctor) {
  return new Data_Functor.Functor(function (f) {
    return function (v) {
      return Data_Bifunctor.lmap(dictBifunctor)(f)(v);
    };
  });
};

var eqFlip = function eqFlip(dictEq) {
  return dictEq;
};

var bifunctorFlip = function bifunctorFlip(dictBifunctor) {
  return new Data_Bifunctor.Bifunctor(function (f) {
    return function (g) {
      return function (v) {
        return Data_Bifunctor.bimap(dictBifunctor)(g)(f)(v);
      };
    };
  });
};

var biapplyFlip = function biapplyFlip(dictBiapply) {
  return new Control_Biapply.Biapply(function () {
    return bifunctorFlip(dictBiapply.Bifunctor0());
  }, function (v) {
    return function (v1) {
      return Control_Biapply.biapply(dictBiapply)(v)(v1);
    };
  });
};

var biapplicativeFlip = function biapplicativeFlip(dictBiapplicative) {
  return new Control_Biapplicative.Biapplicative(function () {
    return biapplyFlip(dictBiapplicative.Biapply0());
  }, function (a) {
    return function (b) {
      return Control_Biapplicative.bipure(dictBiapplicative)(b)(a);
    };
  });
};

module.exports = {
  Flip: Flip,
  newtypeFlip: newtypeFlip,
  eqFlip: eqFlip,
  ordFlip: ordFlip,
  showFlip: showFlip,
  functorFlip: functorFlip,
  bifunctorFlip: bifunctorFlip,
  biapplyFlip: biapplyFlip,
  biapplicativeFlip: biapplicativeFlip
};
},{"../Control.Biapplicative/index.js":"../output/Control.Biapplicative/index.js","../Control.Biapply/index.js":"../output/Control.Biapply/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Bifunctor.Joker/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Biapplicative = require("../Control.Biapplicative/index.js");

var Control_Biapply = require("../Control.Biapply/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Show = require("../Data.Show/index.js");

var Joker = function Joker(x) {
  return x;
};

var showJoker = function showJoker(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Joker " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var ordJoker = function ordJoker(dictOrd) {
  return dictOrd;
};

var newtypeJoker = new Data_Newtype.Newtype(function (n) {
  return n;
}, Joker);

var functorJoker = function functorJoker(dictFunctor) {
  return new Data_Functor.Functor(function (g) {
    return function (v) {
      return Data_Functor.map(dictFunctor)(g)(v);
    };
  });
};

var eqJoker = function eqJoker(dictEq) {
  return dictEq;
};

var bifunctorJoker = function bifunctorJoker(dictFunctor) {
  return new Data_Bifunctor.Bifunctor(function (v) {
    return function (g) {
      return function (v1) {
        return Data_Functor.map(dictFunctor)(g)(v1);
      };
    };
  });
};

var biapplyJoker = function biapplyJoker(dictApply) {
  return new Control_Biapply.Biapply(function () {
    return bifunctorJoker(dictApply.Functor0());
  }, function (v) {
    return function (v1) {
      return Control_Apply.apply(dictApply)(v)(v1);
    };
  });
};

var biapplicativeJoker = function biapplicativeJoker(dictApplicative) {
  return new Control_Biapplicative.Biapplicative(function () {
    return biapplyJoker(dictApplicative.Apply0());
  }, function (v) {
    return function (b) {
      return Control_Applicative.pure(dictApplicative)(b);
    };
  });
};

module.exports = {
  Joker: Joker,
  newtypeJoker: newtypeJoker,
  eqJoker: eqJoker,
  ordJoker: ordJoker,
  showJoker: showJoker,
  functorJoker: functorJoker,
  bifunctorJoker: bifunctorJoker,
  biapplyJoker: biapplyJoker,
  biapplicativeJoker: biapplicativeJoker
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Biapplicative/index.js":"../output/Control.Biapplicative/index.js","../Control.Biapply/index.js":"../output/Control.Biapply/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Bifunctor.Product/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Biapplicative = require("../Control.Biapplicative/index.js");

var Control_Biapply = require("../Control.Biapply/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Show = require("../Data.Show/index.js");

var Product = function () {
  function Product(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Product.create = function (value0) {
    return function (value1) {
      return new Product(value0, value1);
    };
  };

  return Product;
}();

var showProduct = function showProduct(dictShow) {
  return function (dictShow1) {
    return new Data_Show.Show(function (v) {
      return "(Product " + (Data_Show.show(dictShow)(v.value0) + (" " + (Data_Show.show(dictShow1)(v.value1) + ")")));
    });
  };
};

var eqProduct = function eqProduct(dictEq) {
  return function (dictEq1) {
    return new Data_Eq.Eq(function (x) {
      return function (y) {
        return Data_Eq.eq(dictEq)(x.value0)(y.value0) && Data_Eq.eq(dictEq1)(x.value1)(y.value1);
      };
    });
  };
};

var ordProduct = function ordProduct(dictOrd) {
  return function (dictOrd1) {
    return new Data_Ord.Ord(function () {
      return eqProduct(dictOrd.Eq0())(dictOrd1.Eq0());
    }, function (x) {
      return function (y) {
        var v = Data_Ord.compare(dictOrd)(x.value0)(y.value0);

        if (v instanceof Data_Ordering.LT) {
          return Data_Ordering.LT.value;
        }

        ;

        if (v instanceof Data_Ordering.GT) {
          return Data_Ordering.GT.value;
        }

        ;
        return Data_Ord.compare(dictOrd1)(x.value1)(y.value1);
      };
    });
  };
};

var bifunctorProduct = function bifunctorProduct(dictBifunctor) {
  return function (dictBifunctor1) {
    return new Data_Bifunctor.Bifunctor(function (f) {
      return function (g) {
        return function (v) {
          return new Product(Data_Bifunctor.bimap(dictBifunctor)(f)(g)(v.value0), Data_Bifunctor.bimap(dictBifunctor1)(f)(g)(v.value1));
        };
      };
    });
  };
};

var biapplyProduct = function biapplyProduct(dictBiapply) {
  return function (dictBiapply1) {
    return new Control_Biapply.Biapply(function () {
      return bifunctorProduct(dictBiapply.Bifunctor0())(dictBiapply1.Bifunctor0());
    }, function (v) {
      return function (v1) {
        return new Product(Control_Biapply.biapply(dictBiapply)(v.value0)(v1.value0), Control_Biapply.biapply(dictBiapply1)(v.value1)(v1.value1));
      };
    });
  };
};

var biapplicativeProduct = function biapplicativeProduct(dictBiapplicative) {
  return function (dictBiapplicative1) {
    return new Control_Biapplicative.Biapplicative(function () {
      return biapplyProduct(dictBiapplicative.Biapply0())(dictBiapplicative1.Biapply0());
    }, function (a) {
      return function (b) {
        return new Product(Control_Biapplicative.bipure(dictBiapplicative)(a)(b), Control_Biapplicative.bipure(dictBiapplicative1)(a)(b));
      };
    });
  };
};

module.exports = {
  Product: Product,
  eqProduct: eqProduct,
  ordProduct: ordProduct,
  showProduct: showProduct,
  bifunctorProduct: bifunctorProduct,
  biapplyProduct: biapplyProduct,
  biapplicativeProduct: biapplicativeProduct
};
},{"../Control.Biapplicative/index.js":"../output/Control.Biapplicative/index.js","../Control.Biapply/index.js":"../output/Control.Biapply/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Bifunctor.Wrap/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Biapplicative = require("../Control.Biapplicative/index.js");

var Control_Biapply = require("../Control.Biapply/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Show = require("../Data.Show/index.js");

var Wrap = function Wrap(x) {
  return x;
};

var showWrap = function showWrap(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Wrap " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var ordWrap = function ordWrap(dictOrd) {
  return dictOrd;
};

var newtypeWrap = new Data_Newtype.Newtype(function (n) {
  return n;
}, Wrap);

var functorWrap = function functorWrap(dictBifunctor) {
  return new Data_Functor.Functor(function (f) {
    return function (v) {
      return Data_Bifunctor.rmap(dictBifunctor)(f)(v);
    };
  });
};

var eqWrap = function eqWrap(dictEq) {
  return dictEq;
};

var bifunctorWrap = function bifunctorWrap(dictBifunctor) {
  return new Data_Bifunctor.Bifunctor(function (f) {
    return function (g) {
      return function (v) {
        return Data_Bifunctor.bimap(dictBifunctor)(f)(g)(v);
      };
    };
  });
};

var biapplyWrap = function biapplyWrap(dictBiapply) {
  return new Control_Biapply.Biapply(function () {
    return bifunctorWrap(dictBiapply.Bifunctor0());
  }, function (v) {
    return function (v1) {
      return Control_Biapply.biapply(dictBiapply)(v)(v1);
    };
  });
};

var biapplicativeWrap = function biapplicativeWrap(dictBiapplicative) {
  return new Control_Biapplicative.Biapplicative(function () {
    return biapplyWrap(dictBiapplicative.Biapply0());
  }, function (a) {
    return function (b) {
      return Control_Biapplicative.bipure(dictBiapplicative)(a)(b);
    };
  });
};

module.exports = {
  Wrap: Wrap,
  newtypeWrap: newtypeWrap,
  eqWrap: eqWrap,
  ordWrap: ordWrap,
  showWrap: showWrap,
  functorWrap: functorWrap,
  bifunctorWrap: bifunctorWrap,
  biapplyWrap: biapplyWrap,
  biapplicativeWrap: biapplicativeWrap
};
},{"../Control.Biapplicative/index.js":"../output/Control.Biapplicative/index.js","../Control.Biapply/index.js":"../output/Control.Biapply/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Traversable/foreign.js":[function(require,module,exports) {
"use strict"; // jshint maxparams: 3

exports.traverseArrayImpl = function () {
  function array1(a) {
    return [a];
  }

  function array2(a) {
    return function (b) {
      return [a, b];
    };
  }

  function array3(a) {
    return function (b) {
      return function (c) {
        return [a, b, c];
      };
    };
  }

  function concat2(xs) {
    return function (ys) {
      return xs.concat(ys);
    };
  }

  return function (apply) {
    return function (map) {
      return function (pure) {
        return function (f) {
          return function (array) {
            function go(bot, top) {
              switch (top - bot) {
                case 0:
                  return pure([]);

                case 1:
                  return map(array1)(f(array[bot]));

                case 2:
                  return apply(map(array2)(f(array[bot])))(f(array[bot + 1]));

                case 3:
                  return apply(apply(map(array3)(f(array[bot])))(f(array[bot + 1])))(f(array[bot + 2]));

                default:
                  // This slightly tricky pivot selection aims to produce two
                  // even-length partitions where possible.
                  var pivot = bot + Math.floor((top - bot) / 4) * 2;
                  return apply(map(concat2)(go(bot, pivot)))(go(pivot, top));
              }
            }

            return go(0, array.length);
          };
        };
      };
    };
  };
}();
},{}],"../output/Data.Maybe.First/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var First = function First(x) {
  return x;
};

var showFirst = function showFirst(dictShow) {
  return new Data_Show.Show(function (v) {
    return "First (" + (Data_Show.show(Data_Maybe.showMaybe(dictShow))(v) + ")");
  });
};

var semigroupFirst = new Data_Semigroup.Semigroup(function (v) {
  return function (v1) {
    if (v instanceof Data_Maybe.Just) {
      return v;
    }

    ;
    return v1;
  };
});

var ordFirst = function ordFirst(dictOrd) {
  return Data_Maybe.ordMaybe(dictOrd);
};

var ord1First = Data_Maybe.ord1Maybe;
var newtypeFirst = new Data_Newtype.Newtype(function (n) {
  return n;
}, First);
var monoidFirst = new Data_Monoid.Monoid(function () {
  return semigroupFirst;
}, Data_Maybe.Nothing.value);
var monadFirst = Data_Maybe.monadMaybe;
var invariantFirst = Data_Maybe.invariantMaybe;
var functorFirst = Data_Maybe.functorMaybe;
var extendFirst = Data_Maybe.extendMaybe;

var eqFirst = function eqFirst(dictEq) {
  return Data_Maybe.eqMaybe(dictEq);
};

var eq1First = Data_Maybe.eq1Maybe;

var boundedFirst = function boundedFirst(dictBounded) {
  return Data_Maybe.boundedMaybe(dictBounded);
};

var bindFirst = Data_Maybe.bindMaybe;
var applyFirst = Data_Maybe.applyMaybe;
var applicativeFirst = Data_Maybe.applicativeMaybe;
var altFirst = new Control_Alt.Alt(function () {
  return functorFirst;
}, Data_Semigroup.append(semigroupFirst));
var plusFirst = new Control_Plus.Plus(function () {
  return altFirst;
}, Data_Monoid.mempty(monoidFirst));
var alternativeFirst = new Control_Alternative.Alternative(function () {
  return applicativeFirst;
}, function () {
  return plusFirst;
});
var monadZeroFirst = new Control_MonadZero.MonadZero(function () {
  return alternativeFirst;
}, function () {
  return monadFirst;
});
module.exports = {
  First: First,
  newtypeFirst: newtypeFirst,
  eqFirst: eqFirst,
  eq1First: eq1First,
  ordFirst: ordFirst,
  ord1First: ord1First,
  boundedFirst: boundedFirst,
  functorFirst: functorFirst,
  invariantFirst: invariantFirst,
  applyFirst: applyFirst,
  applicativeFirst: applicativeFirst,
  bindFirst: bindFirst,
  monadFirst: monadFirst,
  extendFirst: extendFirst,
  showFirst: showFirst,
  semigroupFirst: semigroupFirst,
  monoidFirst: monoidFirst,
  altFirst: altFirst,
  plusFirst: plusFirst,
  alternativeFirst: alternativeFirst,
  monadZeroFirst: monadZeroFirst
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Maybe.Last/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Last = function Last(x) {
  return x;
};

var showLast = function showLast(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Last " + (Data_Show.show(Data_Maybe.showMaybe(dictShow))(v) + ")");
  });
};

var semigroupLast = new Data_Semigroup.Semigroup(function (v) {
  return function (v1) {
    if (v1 instanceof Data_Maybe.Just) {
      return v1;
    }

    ;

    if (v1 instanceof Data_Maybe.Nothing) {
      return v;
    }

    ;
    throw new Error("Failed pattern match at Data.Maybe.Last (line 52, column 1 - line 54, column 36): " + [v.constructor.name, v1.constructor.name]);
  };
});

var ordLast = function ordLast(dictOrd) {
  return Data_Maybe.ordMaybe(dictOrd);
};

var ord1Last = Data_Maybe.ord1Maybe;
var newtypeLast = new Data_Newtype.Newtype(function (n) {
  return n;
}, Last);
var monoidLast = new Data_Monoid.Monoid(function () {
  return semigroupLast;
}, Data_Maybe.Nothing.value);
var monadLast = Data_Maybe.monadMaybe;
var invariantLast = Data_Maybe.invariantMaybe;
var functorLast = Data_Maybe.functorMaybe;
var extendLast = Data_Maybe.extendMaybe;

var eqLast = function eqLast(dictEq) {
  return Data_Maybe.eqMaybe(dictEq);
};

var eq1Last = Data_Maybe.eq1Maybe;

var boundedLast = function boundedLast(dictBounded) {
  return Data_Maybe.boundedMaybe(dictBounded);
};

var bindLast = Data_Maybe.bindMaybe;
var applyLast = Data_Maybe.applyMaybe;
var applicativeLast = Data_Maybe.applicativeMaybe;
var altLast = new Control_Alt.Alt(function () {
  return functorLast;
}, Data_Semigroup.append(semigroupLast));
var plusLast = new Control_Plus.Plus(function () {
  return altLast;
}, Data_Monoid.mempty(monoidLast));
var alternativeLast = new Control_Alternative.Alternative(function () {
  return applicativeLast;
}, function () {
  return plusLast;
});
var monadZeroLast = new Control_MonadZero.MonadZero(function () {
  return alternativeLast;
}, function () {
  return monadLast;
});
module.exports = {
  Last: Last,
  newtypeLast: newtypeLast,
  eqLast: eqLast,
  eq1Last: eq1Last,
  ordLast: ordLast,
  ord1Last: ord1Last,
  boundedLast: boundedLast,
  functorLast: functorLast,
  invariantLast: invariantLast,
  applyLast: applyLast,
  applicativeLast: applicativeLast,
  bindLast: bindLast,
  monadLast: monadLast,
  extendLast: extendLast,
  showLast: showLast,
  semigroupLast: semigroupLast,
  monoidLast: monoidLast,
  altLast: altLast,
  plusLast: plusLast,
  alternativeLast: alternativeLast,
  monadZeroLast: monadZeroLast
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Traversable.Accum.Internal/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var StateR = function StateR(x) {
  return x;
};

var StateL = function StateL(x) {
  return x;
};

var stateR = function stateR(v) {
  return v;
};

var stateL = function stateL(v) {
  return v;
};

var functorStateR = new Data_Functor.Functor(function (f) {
  return function (k) {
    return function (s) {
      var v = stateR(k)(s);
      return {
        accum: v.accum,
        value: f(v.value)
      };
    };
  };
});
var functorStateL = new Data_Functor.Functor(function (f) {
  return function (k) {
    return function (s) {
      var v = stateL(k)(s);
      return {
        accum: v.accum,
        value: f(v.value)
      };
    };
  };
});
var applyStateR = new Control_Apply.Apply(function () {
  return functorStateR;
}, function (f) {
  return function (x) {
    return function (s) {
      var v = stateR(x)(s);
      var v1 = stateR(f)(v.accum);
      return {
        accum: v1.accum,
        value: v1.value(v.value)
      };
    };
  };
});
var applyStateL = new Control_Apply.Apply(function () {
  return functorStateL;
}, function (f) {
  return function (x) {
    return function (s) {
      var v = stateL(f)(s);
      var v1 = stateL(x)(v.accum);
      return {
        accum: v1.accum,
        value: v.value(v1.value)
      };
    };
  };
});
var applicativeStateR = new Control_Applicative.Applicative(function () {
  return applyStateR;
}, function (a) {
  return function (s) {
    return {
      accum: s,
      value: a
    };
  };
});
var applicativeStateL = new Control_Applicative.Applicative(function () {
  return applyStateL;
}, function (a) {
  return function (s) {
    return {
      accum: s,
      value: a
    };
  };
});
module.exports = {
  StateL: StateL,
  stateL: stateL,
  StateR: StateR,
  stateR: stateR,
  functorStateL: functorStateL,
  applyStateL: applyStateL,
  applicativeStateL: applicativeStateL,
  functorStateR: functorStateR,
  applyStateR: applyStateR,
  applicativeStateR: applicativeStateR
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js"}],"../output/Data.Traversable/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Maybe_First = require("../Data.Maybe.First/index.js");

var Data_Maybe_Last = require("../Data.Maybe.Last/index.js");

var Data_Monoid_Additive = require("../Data.Monoid.Additive/index.js");

var Data_Monoid_Conj = require("../Data.Monoid.Conj/index.js");

var Data_Monoid_Disj = require("../Data.Monoid.Disj/index.js");

var Data_Monoid_Dual = require("../Data.Monoid.Dual/index.js");

var Data_Monoid_Multiplicative = require("../Data.Monoid.Multiplicative/index.js");

var Data_Traversable_Accum_Internal = require("../Data.Traversable.Accum.Internal/index.js");

var Traversable = function Traversable(Foldable1, Functor0, sequence, traverse) {
  this.Foldable1 = Foldable1;
  this.Functor0 = Functor0;
  this.sequence = sequence;
  this.traverse = traverse;
};

var traverse = function traverse(dict) {
  return dict.traverse;
};

var traversableMultiplicative = new Traversable(function () {
  return Data_Foldable.foldableMultiplicative;
}, function () {
  return Data_Monoid_Multiplicative.functorMultiplicative;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Multiplicative.Multiplicative)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Multiplicative.Multiplicative)(f(v));
    };
  };
});
var traversableMaybe = new Traversable(function () {
  return Data_Foldable.foldableMaybe;
}, function () {
  return Data_Maybe.functorMaybe;
}, function (dictApplicative) {
  return function (v) {
    if (v instanceof Data_Maybe.Nothing) {
      return Control_Applicative.pure(dictApplicative)(Data_Maybe.Nothing.value);
    }

    ;

    if (v instanceof Data_Maybe.Just) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Maybe.Just.create)(v.value0);
    }

    ;
    throw new Error("Failed pattern match at Data.Traversable (line 86, column 1 - line 90, column 33): " + [v.constructor.name]);
  };
}, function (dictApplicative) {
  return function (v) {
    return function (v1) {
      if (v1 instanceof Data_Maybe.Nothing) {
        return Control_Applicative.pure(dictApplicative)(Data_Maybe.Nothing.value);
      }

      ;

      if (v1 instanceof Data_Maybe.Just) {
        return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Maybe.Just.create)(v(v1.value0));
      }

      ;
      throw new Error("Failed pattern match at Data.Traversable (line 86, column 1 - line 90, column 33): " + [v.constructor.name, v1.constructor.name]);
    };
  };
});
var traversableDual = new Traversable(function () {
  return Data_Foldable.foldableDual;
}, function () {
  return Data_Monoid_Dual.functorDual;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Dual.Dual)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Dual.Dual)(f(v));
    };
  };
});
var traversableDisj = new Traversable(function () {
  return Data_Foldable.foldableDisj;
}, function () {
  return Data_Monoid_Disj.functorDisj;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Disj.Disj)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Disj.Disj)(f(v));
    };
  };
});
var traversableConj = new Traversable(function () {
  return Data_Foldable.foldableConj;
}, function () {
  return Data_Monoid_Conj.functorConj;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Conj.Conj)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Conj.Conj)(f(v));
    };
  };
});
var traversableAdditive = new Traversable(function () {
  return Data_Foldable.foldableAdditive;
}, function () {
  return Data_Monoid_Additive.functorAdditive;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Additive.Additive)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Monoid_Additive.Additive)(f(v));
    };
  };
});

var sequenceDefault = function sequenceDefault(dictTraversable) {
  return function (dictApplicative) {
    return traverse(dictTraversable)(dictApplicative)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var traversableArray = new Traversable(function () {
  return Data_Foldable.foldableArray;
}, function () {
  return Data_Functor.functorArray;
}, function (dictApplicative) {
  return sequenceDefault(traversableArray)(dictApplicative);
}, function (dictApplicative) {
  return $foreign.traverseArrayImpl(Control_Apply.apply(dictApplicative.Apply0()))(Data_Functor.map(dictApplicative.Apply0().Functor0()))(Control_Applicative.pure(dictApplicative));
});

var sequence = function sequence(dict) {
  return dict.sequence;
};

var traversableFirst = new Traversable(function () {
  return Data_Foldable.foldableFirst;
}, function () {
  return Data_Maybe_First.functorFirst;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Maybe_First.First)(sequence(traversableMaybe)(dictApplicative)(v));
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Maybe_First.First)(traverse(traversableMaybe)(dictApplicative)(f)(v));
    };
  };
});
var traversableLast = new Traversable(function () {
  return Data_Foldable.foldableLast;
}, function () {
  return Data_Maybe_Last.functorLast;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Maybe_Last.Last)(sequence(traversableMaybe)(dictApplicative)(v));
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Maybe_Last.Last)(traverse(traversableMaybe)(dictApplicative)(f)(v));
    };
  };
});

var traverseDefault = function traverseDefault(dictTraversable) {
  return function (dictApplicative) {
    return function (f) {
      return function (ta) {
        return sequence(dictTraversable)(dictApplicative)(Data_Functor.map(dictTraversable.Functor0())(f)(ta));
      };
    };
  };
};

var mapAccumR = function mapAccumR(dictTraversable) {
  return function (f) {
    return function (s0) {
      return function (xs) {
        return Data_Traversable_Accum_Internal.stateR(traverse(dictTraversable)(Data_Traversable_Accum_Internal.applicativeStateR)(function (a) {
          return function (s) {
            return f(s)(a);
          };
        })(xs))(s0);
      };
    };
  };
};

var scanr = function scanr(dictTraversable) {
  return function (f) {
    return function (b0) {
      return function (xs) {
        return mapAccumR(dictTraversable)(function (b) {
          return function (a) {
            var b$prime = f(a)(b);
            return {
              accum: b$prime,
              value: b$prime
            };
          };
        })(b0)(xs).value;
      };
    };
  };
};

var mapAccumL = function mapAccumL(dictTraversable) {
  return function (f) {
    return function (s0) {
      return function (xs) {
        return Data_Traversable_Accum_Internal.stateL(traverse(dictTraversable)(Data_Traversable_Accum_Internal.applicativeStateL)(function (a) {
          return function (s) {
            return f(s)(a);
          };
        })(xs))(s0);
      };
    };
  };
};

var scanl = function scanl(dictTraversable) {
  return function (f) {
    return function (b0) {
      return function (xs) {
        return mapAccumL(dictTraversable)(function (b) {
          return function (a) {
            var b$prime = f(b)(a);
            return {
              accum: b$prime,
              value: b$prime
            };
          };
        })(b0)(xs).value;
      };
    };
  };
};

var $$for = function $$for(dictApplicative) {
  return function (dictTraversable) {
    return function (x) {
      return function (f) {
        return traverse(dictTraversable)(dictApplicative)(f)(x);
      };
    };
  };
};

module.exports = {
  Traversable: Traversable,
  traverse: traverse,
  sequence: sequence,
  traverseDefault: traverseDefault,
  sequenceDefault: sequenceDefault,
  "for": $$for,
  scanl: scanl,
  scanr: scanr,
  mapAccumL: mapAccumL,
  mapAccumR: mapAccumR,
  traversableArray: traversableArray,
  traversableMaybe: traversableMaybe,
  traversableFirst: traversableFirst,
  traversableLast: traversableLast,
  traversableAdditive: traversableAdditive,
  traversableDual: traversableDual,
  traversableConj: traversableConj,
  traversableDisj: traversableDisj,
  traversableMultiplicative: traversableMultiplicative
};
},{"./foreign.js":"../output/Data.Traversable/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Maybe.First/index.js":"../output/Data.Maybe.First/index.js","../Data.Maybe.Last/index.js":"../output/Data.Maybe.Last/index.js","../Data.Monoid.Additive/index.js":"../output/Data.Monoid.Additive/index.js","../Data.Monoid.Conj/index.js":"../output/Data.Monoid.Conj/index.js","../Data.Monoid.Disj/index.js":"../output/Data.Monoid.Disj/index.js","../Data.Monoid.Dual/index.js":"../output/Data.Monoid.Dual/index.js","../Data.Monoid.Multiplicative/index.js":"../output/Data.Monoid.Multiplicative/index.js","../Data.Traversable.Accum.Internal/index.js":"../output/Data.Traversable.Accum.Internal/index.js"}],"../output/Data.Bitraversable/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Bifoldable = require("../Data.Bifoldable/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Bifunctor_Clown = require("../Data.Bifunctor.Clown/index.js");

var Data_Bifunctor_Flip = require("../Data.Bifunctor.Flip/index.js");

var Data_Bifunctor_Joker = require("../Data.Bifunctor.Joker/index.js");

var Data_Bifunctor_Product = require("../Data.Bifunctor.Product/index.js");

var Data_Bifunctor_Wrap = require("../Data.Bifunctor.Wrap/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Bitraversable = function Bitraversable(Bifoldable1, Bifunctor0, bisequence, bitraverse) {
  this.Bifoldable1 = Bifoldable1;
  this.Bifunctor0 = Bifunctor0;
  this.bisequence = bisequence;
  this.bitraverse = bitraverse;
};

var bitraverse = function bitraverse(dict) {
  return dict.bitraverse;
};

var lfor = function lfor(dictBitraversable) {
  return function (dictApplicative) {
    return function (t) {
      return function (f) {
        return bitraverse(dictBitraversable)(dictApplicative)(f)(Control_Applicative.pure(dictApplicative))(t);
      };
    };
  };
};

var ltraverse = function ltraverse(dictBitraversable) {
  return function (dictApplicative) {
    return function (f) {
      return bitraverse(dictBitraversable)(dictApplicative)(f)(Control_Applicative.pure(dictApplicative));
    };
  };
};

var rfor = function rfor(dictBitraversable) {
  return function (dictApplicative) {
    return function (t) {
      return function (f) {
        return bitraverse(dictBitraversable)(dictApplicative)(Control_Applicative.pure(dictApplicative))(f)(t);
      };
    };
  };
};

var rtraverse = function rtraverse(dictBitraversable) {
  return function (dictApplicative) {
    return bitraverse(dictBitraversable)(dictApplicative)(Control_Applicative.pure(dictApplicative));
  };
};

var bitraversableJoker = function bitraversableJoker(dictTraversable) {
  return new Bitraversable(function () {
    return Data_Bifoldable.bifoldableJoker(dictTraversable.Foldable1());
  }, function () {
    return Data_Bifunctor_Joker.bifunctorJoker(dictTraversable.Functor0());
  }, function (dictApplicative) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Joker.Joker)(Data_Traversable.sequence(dictTraversable)(dictApplicative)(v));
    };
  }, function (dictApplicative) {
    return function (v) {
      return function (r) {
        return function (v1) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Joker.Joker)(Data_Traversable.traverse(dictTraversable)(dictApplicative)(r)(v1));
        };
      };
    };
  });
};

var bitraversableClown = function bitraversableClown(dictTraversable) {
  return new Bitraversable(function () {
    return Data_Bifoldable.bifoldableClown(dictTraversable.Foldable1());
  }, function () {
    return Data_Bifunctor_Clown.bifunctorClown(dictTraversable.Functor0());
  }, function (dictApplicative) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Clown.Clown)(Data_Traversable.sequence(dictTraversable)(dictApplicative)(v));
    };
  }, function (dictApplicative) {
    return function (l) {
      return function (v) {
        return function (v1) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Clown.Clown)(Data_Traversable.traverse(dictTraversable)(dictApplicative)(l)(v1));
        };
      };
    };
  });
};

var bisequenceDefault = function bisequenceDefault(dictBitraversable) {
  return function (dictApplicative) {
    return bitraverse(dictBitraversable)(dictApplicative)(Control_Category.identity(Control_Category.categoryFn))(Control_Category.identity(Control_Category.categoryFn));
  };
};

var bisequence = function bisequence(dict) {
  return dict.bisequence;
};

var bitraversableFlip = function bitraversableFlip(dictBitraversable) {
  return new Bitraversable(function () {
    return Data_Bifoldable.bifoldableFlip(dictBitraversable.Bifoldable1());
  }, function () {
    return Data_Bifunctor_Flip.bifunctorFlip(dictBitraversable.Bifunctor0());
  }, function (dictApplicative) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Flip.Flip)(bisequence(dictBitraversable)(dictApplicative)(v));
    };
  }, function (dictApplicative) {
    return function (r) {
      return function (l) {
        return function (v) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Flip.Flip)(bitraverse(dictBitraversable)(dictApplicative)(l)(r)(v));
        };
      };
    };
  });
};

var bitraversableProduct = function bitraversableProduct(dictBitraversable) {
  return function (dictBitraversable1) {
    return new Bitraversable(function () {
      return Data_Bifoldable.bifoldableProduct(dictBitraversable.Bifoldable1())(dictBitraversable1.Bifoldable1());
    }, function () {
      return Data_Bifunctor_Product.bifunctorProduct(dictBitraversable.Bifunctor0())(dictBitraversable1.Bifunctor0());
    }, function (dictApplicative) {
      return function (v) {
        return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Product.Product.create)(bisequence(dictBitraversable)(dictApplicative)(v.value0)))(bisequence(dictBitraversable1)(dictApplicative)(v.value1));
      };
    }, function (dictApplicative) {
      return function (l) {
        return function (r) {
          return function (v) {
            return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Product.Product.create)(bitraverse(dictBitraversable)(dictApplicative)(l)(r)(v.value0)))(bitraverse(dictBitraversable1)(dictApplicative)(l)(r)(v.value1));
          };
        };
      };
    });
  };
};

var bitraversableWrap = function bitraversableWrap(dictBitraversable) {
  return new Bitraversable(function () {
    return Data_Bifoldable.bifoldableWrap(dictBitraversable.Bifoldable1());
  }, function () {
    return Data_Bifunctor_Wrap.bifunctorWrap(dictBitraversable.Bifunctor0());
  }, function (dictApplicative) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Wrap.Wrap)(bisequence(dictBitraversable)(dictApplicative)(v));
    };
  }, function (dictApplicative) {
    return function (l) {
      return function (r) {
        return function (v) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Bifunctor_Wrap.Wrap)(bitraverse(dictBitraversable)(dictApplicative)(l)(r)(v));
        };
      };
    };
  });
};

var bitraverseDefault = function bitraverseDefault(dictBitraversable) {
  return function (dictApplicative) {
    return function (f) {
      return function (g) {
        return function (t) {
          return bisequence(dictBitraversable)(dictApplicative)(Data_Bifunctor.bimap(dictBitraversable.Bifunctor0())(f)(g)(t));
        };
      };
    };
  };
};

var bifor = function bifor(dictBitraversable) {
  return function (dictApplicative) {
    return function (t) {
      return function (f) {
        return function (g) {
          return bitraverse(dictBitraversable)(dictApplicative)(f)(g)(t);
        };
      };
    };
  };
};

module.exports = {
  Bitraversable: Bitraversable,
  bitraverse: bitraverse,
  bisequence: bisequence,
  bitraverseDefault: bitraverseDefault,
  bisequenceDefault: bisequenceDefault,
  ltraverse: ltraverse,
  rtraverse: rtraverse,
  bifor: bifor,
  lfor: lfor,
  rfor: rfor,
  bitraversableClown: bitraversableClown,
  bitraversableJoker: bitraversableJoker,
  bitraversableFlip: bitraversableFlip,
  bitraversableProduct: bitraversableProduct,
  bitraversableWrap: bitraversableWrap
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Bifoldable/index.js":"../output/Data.Bifoldable/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Bifunctor.Clown/index.js":"../output/Data.Bifunctor.Clown/index.js","../Data.Bifunctor.Flip/index.js":"../output/Data.Bifunctor.Flip/index.js","../Data.Bifunctor.Joker/index.js":"../output/Data.Bifunctor.Joker/index.js","../Data.Bifunctor.Product/index.js":"../output/Data.Bifunctor.Product/index.js","../Data.Bifunctor.Wrap/index.js":"../output/Data.Bifunctor.Wrap/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js"}],"../output/Data.FunctorWithIndex/foreign.js":[function(require,module,exports) {
"use strict";

exports.mapWithIndexArray = function (f) {
  return function (xs) {
    var l = xs.length;
    var result = Array(l);

    for (var i = 0; i < l; i++) {
      result[i] = f(i)(xs[i]);
    }

    return result;
  };
};
},{}],"../output/Data.FunctorWithIndex/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Maybe_First = require("../Data.Maybe.First/index.js");

var Data_Maybe_Last = require("../Data.Maybe.Last/index.js");

var Data_Monoid_Additive = require("../Data.Monoid.Additive/index.js");

var Data_Monoid_Conj = require("../Data.Monoid.Conj/index.js");

var Data_Monoid_Disj = require("../Data.Monoid.Disj/index.js");

var Data_Monoid_Dual = require("../Data.Monoid.Dual/index.js");

var Data_Monoid_Multiplicative = require("../Data.Monoid.Multiplicative/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var FunctorWithIndex = function FunctorWithIndex(Functor0, mapWithIndex) {
  this.Functor0 = Functor0;
  this.mapWithIndex = mapWithIndex;
};

var mapWithIndex = function mapWithIndex(dict) {
  return dict.mapWithIndex;
};

var mapDefault = function mapDefault(dictFunctorWithIndex) {
  return function (f) {
    return mapWithIndex(dictFunctorWithIndex)(Data_Function["const"](f));
  };
};

var functorWithIndexMultiplicative = new FunctorWithIndex(function () {
  return Data_Monoid_Multiplicative.functorMultiplicative;
}, function (f) {
  return Data_Functor.map(Data_Monoid_Multiplicative.functorMultiplicative)(f(Data_Unit.unit));
});
var functorWithIndexMaybe = new FunctorWithIndex(function () {
  return Data_Maybe.functorMaybe;
}, function (f) {
  return Data_Functor.map(Data_Maybe.functorMaybe)(f(Data_Unit.unit));
});
var functorWithIndexLast = new FunctorWithIndex(function () {
  return Data_Maybe_Last.functorLast;
}, function (f) {
  return Data_Functor.map(Data_Maybe_Last.functorLast)(f(Data_Unit.unit));
});
var functorWithIndexFirst = new FunctorWithIndex(function () {
  return Data_Maybe_First.functorFirst;
}, function (f) {
  return Data_Functor.map(Data_Maybe_First.functorFirst)(f(Data_Unit.unit));
});
var functorWithIndexDual = new FunctorWithIndex(function () {
  return Data_Monoid_Dual.functorDual;
}, function (f) {
  return Data_Functor.map(Data_Monoid_Dual.functorDual)(f(Data_Unit.unit));
});
var functorWithIndexDisj = new FunctorWithIndex(function () {
  return Data_Monoid_Disj.functorDisj;
}, function (f) {
  return Data_Functor.map(Data_Monoid_Disj.functorDisj)(f(Data_Unit.unit));
});
var functorWithIndexConj = new FunctorWithIndex(function () {
  return Data_Monoid_Conj.functorConj;
}, function (f) {
  return Data_Functor.map(Data_Monoid_Conj.functorConj)(f(Data_Unit.unit));
});
var functorWithIndexArray = new FunctorWithIndex(function () {
  return Data_Functor.functorArray;
}, $foreign.mapWithIndexArray);
var functorWithIndexAdditive = new FunctorWithIndex(function () {
  return Data_Monoid_Additive.functorAdditive;
}, function (f) {
  return Data_Functor.map(Data_Monoid_Additive.functorAdditive)(f(Data_Unit.unit));
});
module.exports = {
  FunctorWithIndex: FunctorWithIndex,
  mapWithIndex: mapWithIndex,
  mapDefault: mapDefault,
  functorWithIndexArray: functorWithIndexArray,
  functorWithIndexMaybe: functorWithIndexMaybe,
  functorWithIndexFirst: functorWithIndexFirst,
  functorWithIndexLast: functorWithIndexLast,
  functorWithIndexAdditive: functorWithIndexAdditive,
  functorWithIndexDual: functorWithIndexDual,
  functorWithIndexConj: functorWithIndexConj,
  functorWithIndexDisj: functorWithIndexDisj,
  functorWithIndexMultiplicative: functorWithIndexMultiplicative
};
},{"./foreign.js":"../output/Data.FunctorWithIndex/foreign.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Maybe.First/index.js":"../output/Data.Maybe.First/index.js","../Data.Maybe.Last/index.js":"../output/Data.Maybe.Last/index.js","../Data.Monoid.Additive/index.js":"../output/Data.Monoid.Additive/index.js","../Data.Monoid.Conj/index.js":"../output/Data.Monoid.Conj/index.js","../Data.Monoid.Disj/index.js":"../output/Data.Monoid.Disj/index.js","../Data.Monoid.Dual/index.js":"../output/Data.Monoid.Dual/index.js","../Data.Monoid.Multiplicative/index.js":"../output/Data.Monoid.Multiplicative/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.FoldableWithIndex/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Monoid_Conj = require("../Data.Monoid.Conj/index.js");

var Data_Monoid_Disj = require("../Data.Monoid.Disj/index.js");

var Data_Monoid_Dual = require("../Data.Monoid.Dual/index.js");

var Data_Monoid_Endo = require("../Data.Monoid.Endo/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Tuple = function () {
  function Tuple(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Tuple.create = function (value0) {
    return function (value1) {
      return new Tuple(value0, value1);
    };
  };

  return Tuple;
}();

var FoldableWithIndex = function FoldableWithIndex(Foldable0, foldMapWithIndex, foldlWithIndex, foldrWithIndex) {
  this.Foldable0 = Foldable0;
  this.foldMapWithIndex = foldMapWithIndex;
  this.foldlWithIndex = foldlWithIndex;
  this.foldrWithIndex = foldrWithIndex;
};

var foldrWithIndex = function foldrWithIndex(dict) {
  return dict.foldrWithIndex;
};

var traverseWithIndex_ = function traverseWithIndex_(dictApplicative) {
  return function (dictFoldableWithIndex) {
    return function (f) {
      return foldrWithIndex(dictFoldableWithIndex)(function (i) {
        var $46 = Control_Apply.applySecond(dictApplicative.Apply0());
        var $47 = f(i);
        return function ($48) {
          return $46($47($48));
        };
      })(Control_Applicative.pure(dictApplicative)(Data_Unit.unit));
    };
  };
};

var forWithIndex_ = function forWithIndex_(dictApplicative) {
  return function (dictFoldableWithIndex) {
    return Data_Function.flip(traverseWithIndex_(dictApplicative)(dictFoldableWithIndex));
  };
};

var foldrDefault = function foldrDefault(dictFoldableWithIndex) {
  return function (f) {
    return foldrWithIndex(dictFoldableWithIndex)(Data_Function["const"](f));
  };
};

var foldlWithIndex = function foldlWithIndex(dict) {
  return dict.foldlWithIndex;
};

var foldlDefault = function foldlDefault(dictFoldableWithIndex) {
  return function (f) {
    return foldlWithIndex(dictFoldableWithIndex)(Data_Function["const"](f));
  };
};

var foldableWithIndexMultiplicative = new FoldableWithIndex(function () {
  return Data_Foldable.foldableMultiplicative;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableMultiplicative)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableMultiplicative)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableMultiplicative)(f(Data_Unit.unit));
});
var foldableWithIndexMaybe = new FoldableWithIndex(function () {
  return Data_Foldable.foldableMaybe;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableMaybe)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableMaybe)(f(Data_Unit.unit));
});
var foldableWithIndexLast = new FoldableWithIndex(function () {
  return Data_Foldable.foldableLast;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableLast)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableLast)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableLast)(f(Data_Unit.unit));
});
var foldableWithIndexFirst = new FoldableWithIndex(function () {
  return Data_Foldable.foldableFirst;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableFirst)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableFirst)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableFirst)(f(Data_Unit.unit));
});
var foldableWithIndexDual = new FoldableWithIndex(function () {
  return Data_Foldable.foldableDual;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableDual)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableDual)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableDual)(f(Data_Unit.unit));
});
var foldableWithIndexDisj = new FoldableWithIndex(function () {
  return Data_Foldable.foldableDisj;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableDisj)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableDisj)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableDisj)(f(Data_Unit.unit));
});
var foldableWithIndexConj = new FoldableWithIndex(function () {
  return Data_Foldable.foldableConj;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableConj)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableConj)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableConj)(f(Data_Unit.unit));
});
var foldableWithIndexAdditive = new FoldableWithIndex(function () {
  return Data_Foldable.foldableAdditive;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(Data_Foldable.foldableAdditive)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(Data_Foldable.foldableAdditive)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(Data_Foldable.foldableAdditive)(f(Data_Unit.unit));
});

var foldWithIndexM = function foldWithIndexM(dictFoldableWithIndex) {
  return function (dictMonad) {
    return function (f) {
      return function (a0) {
        return foldlWithIndex(dictFoldableWithIndex)(function (i) {
          return function (ma) {
            return function (b) {
              return Control_Bind.bind(dictMonad.Bind1())(ma)(Data_Function.flip(f(i))(b));
            };
          };
        })(Control_Applicative.pure(dictMonad.Applicative0())(a0));
      };
    };
  };
};

var foldMapWithIndexDefaultR = function foldMapWithIndexDefaultR(dictFoldableWithIndex) {
  return function (dictMonoid) {
    return function (f) {
      return foldrWithIndex(dictFoldableWithIndex)(function (i) {
        return function (x) {
          return function (acc) {
            return Data_Semigroup.append(dictMonoid.Semigroup0())(f(i)(x))(acc);
          };
        };
      })(Data_Monoid.mempty(dictMonoid));
    };
  };
};

var foldableWithIndexArray = new FoldableWithIndex(function () {
  return Data_Foldable.foldableArray;
}, function (dictMonoid) {
  return foldMapWithIndexDefaultR(foldableWithIndexArray)(dictMonoid);
}, function (f) {
  return function (z) {
    var $49 = Data_Foldable.foldl(Data_Foldable.foldableArray)(function (y) {
      return function (v) {
        return f(v.value0)(y)(v.value1);
      };
    })(z);
    var $50 = Data_FunctorWithIndex.mapWithIndex(Data_FunctorWithIndex.functorWithIndexArray)(Tuple.create);
    return function ($51) {
      return $49($50($51));
    };
  };
}, function (f) {
  return function (z) {
    var $52 = Data_Foldable.foldr(Data_Foldable.foldableArray)(function (v) {
      return function (y) {
        return f(v.value0)(v.value1)(y);
      };
    })(z);
    var $53 = Data_FunctorWithIndex.mapWithIndex(Data_FunctorWithIndex.functorWithIndexArray)(Tuple.create);
    return function ($54) {
      return $52($53($54));
    };
  };
});

var foldMapWithIndexDefaultL = function foldMapWithIndexDefaultL(dictFoldableWithIndex) {
  return function (dictMonoid) {
    return function (f) {
      return foldlWithIndex(dictFoldableWithIndex)(function (i) {
        return function (acc) {
          return function (x) {
            return Data_Semigroup.append(dictMonoid.Semigroup0())(acc)(f(i)(x));
          };
        };
      })(Data_Monoid.mempty(dictMonoid));
    };
  };
};

var foldMapWithIndex = function foldMapWithIndex(dict) {
  return dict.foldMapWithIndex;
};

var foldlWithIndexDefault = function foldlWithIndexDefault(dictFoldableWithIndex) {
  return function (c) {
    return function (u) {
      return function (xs) {
        return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(Data_Newtype.unwrap(Data_Newtype.newtypeDual)(foldMapWithIndex(dictFoldableWithIndex)(Data_Monoid_Dual.monoidDual(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn)))(function (i) {
          var $55 = Data_Function.flip(c(i));
          return function ($56) {
            return Data_Monoid_Dual.Dual(Data_Monoid_Endo.Endo($55($56)));
          };
        })(xs)))(u);
      };
    };
  };
};

var foldrWithIndexDefault = function foldrWithIndexDefault(dictFoldableWithIndex) {
  return function (c) {
    return function (u) {
      return function (xs) {
        return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(foldMapWithIndex(dictFoldableWithIndex)(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn))(function (i) {
          var $57 = c(i);
          return function ($58) {
            return Data_Monoid_Endo.Endo($57($58));
          };
        })(xs))(u);
      };
    };
  };
};

var surroundMapWithIndex = function surroundMapWithIndex(dictFoldableWithIndex) {
  return function (dictSemigroup) {
    return function (d) {
      return function (t) {
        return function (f) {
          var joined = function joined(i) {
            return function (a) {
              return function (m) {
                return Data_Semigroup.append(dictSemigroup)(d)(Data_Semigroup.append(dictSemigroup)(t(i)(a))(m));
              };
            };
          };

          return Data_Newtype.unwrap(Data_Newtype.newtypeEndo)(foldMapWithIndex(dictFoldableWithIndex)(Data_Monoid_Endo.monoidEndo(Control_Category.categoryFn))(joined)(f))(d);
        };
      };
    };
  };
};

var foldMapDefault = function foldMapDefault(dictFoldableWithIndex) {
  return function (dictMonoid) {
    return function (f) {
      return foldMapWithIndex(dictFoldableWithIndex)(dictMonoid)(Data_Function["const"](f));
    };
  };
};

var findWithIndex = function findWithIndex(dictFoldableWithIndex) {
  return function (p) {
    var go = function go(v) {
      return function (v1) {
        return function (v2) {
          if (v1 instanceof Data_Maybe.Nothing && p(v)(v2)) {
            return new Data_Maybe.Just({
              index: v,
              value: v2
            });
          }

          ;
          return v1;
        };
      };
    };

    return foldlWithIndex(dictFoldableWithIndex)(go)(Data_Maybe.Nothing.value);
  };
};

var anyWithIndex = function anyWithIndex(dictFoldableWithIndex) {
  return function (dictHeytingAlgebra) {
    return function (t) {
      var $59 = Data_Newtype.unwrap(Data_Newtype.newtypeDisj);
      var $60 = foldMapWithIndex(dictFoldableWithIndex)(Data_Monoid_Disj.monoidDisj(dictHeytingAlgebra))(function (i) {
        var $62 = t(i);
        return function ($63) {
          return Data_Monoid_Disj.Disj($62($63));
        };
      });
      return function ($61) {
        return $59($60($61));
      };
    };
  };
};

var allWithIndex = function allWithIndex(dictFoldableWithIndex) {
  return function (dictHeytingAlgebra) {
    return function (t) {
      var $64 = Data_Newtype.unwrap(Data_Newtype.newtypeConj);
      var $65 = foldMapWithIndex(dictFoldableWithIndex)(Data_Monoid_Conj.monoidConj(dictHeytingAlgebra))(function (i) {
        var $67 = t(i);
        return function ($68) {
          return Data_Monoid_Conj.Conj($67($68));
        };
      });
      return function ($66) {
        return $64($65($66));
      };
    };
  };
};

module.exports = {
  FoldableWithIndex: FoldableWithIndex,
  foldrWithIndex: foldrWithIndex,
  foldlWithIndex: foldlWithIndex,
  foldMapWithIndex: foldMapWithIndex,
  foldrWithIndexDefault: foldrWithIndexDefault,
  foldlWithIndexDefault: foldlWithIndexDefault,
  foldMapWithIndexDefaultR: foldMapWithIndexDefaultR,
  foldMapWithIndexDefaultL: foldMapWithIndexDefaultL,
  foldWithIndexM: foldWithIndexM,
  traverseWithIndex_: traverseWithIndex_,
  forWithIndex_: forWithIndex_,
  surroundMapWithIndex: surroundMapWithIndex,
  allWithIndex: allWithIndex,
  anyWithIndex: anyWithIndex,
  findWithIndex: findWithIndex,
  foldrDefault: foldrDefault,
  foldlDefault: foldlDefault,
  foldMapDefault: foldMapDefault,
  foldableWithIndexArray: foldableWithIndexArray,
  foldableWithIndexMaybe: foldableWithIndexMaybe,
  foldableWithIndexFirst: foldableWithIndexFirst,
  foldableWithIndexLast: foldableWithIndexLast,
  foldableWithIndexAdditive: foldableWithIndexAdditive,
  foldableWithIndexDual: foldableWithIndexDual,
  foldableWithIndexDisj: foldableWithIndexDisj,
  foldableWithIndexConj: foldableWithIndexConj,
  foldableWithIndexMultiplicative: foldableWithIndexMultiplicative
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Monoid.Conj/index.js":"../output/Data.Monoid.Conj/index.js","../Data.Monoid.Disj/index.js":"../output/Data.Monoid.Disj/index.js","../Data.Monoid.Dual/index.js":"../output/Data.Monoid.Dual/index.js","../Data.Monoid.Endo/index.js":"../output/Data.Monoid.Endo/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.TraversableWithIndex/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_Traversable_Accum_Internal = require("../Data.Traversable.Accum.Internal/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var TraversableWithIndex = function TraversableWithIndex(FoldableWithIndex1, FunctorWithIndex0, Traversable2, traverseWithIndex) {
  this.FoldableWithIndex1 = FoldableWithIndex1;
  this.FunctorWithIndex0 = FunctorWithIndex0;
  this.Traversable2 = Traversable2;
  this.traverseWithIndex = traverseWithIndex;
};

var traverseWithIndexDefault = function traverseWithIndexDefault(dictTraversableWithIndex) {
  return function (dictApplicative) {
    return function (f) {
      var $19 = Data_Traversable.sequence(dictTraversableWithIndex.Traversable2())(dictApplicative);
      var $20 = Data_FunctorWithIndex.mapWithIndex(dictTraversableWithIndex.FunctorWithIndex0())(f);
      return function ($21) {
        return $19($20($21));
      };
    };
  };
};

var traverseWithIndex = function traverseWithIndex(dict) {
  return dict.traverseWithIndex;
};

var traverseDefault = function traverseDefault(dictTraversableWithIndex) {
  return function (dictApplicative) {
    return function (f) {
      return traverseWithIndex(dictTraversableWithIndex)(dictApplicative)(Data_Function["const"](f));
    };
  };
};

var traversableWithIndexMultiplicative = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexMultiplicative;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexMultiplicative;
}, function () {
  return Data_Traversable.traversableMultiplicative;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableMultiplicative)(dictApplicative)(f(Data_Unit.unit));
  };
});
var traversableWithIndexMaybe = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexMaybe;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexMaybe;
}, function () {
  return Data_Traversable.traversableMaybe;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableMaybe)(dictApplicative)(f(Data_Unit.unit));
  };
});
var traversableWithIndexLast = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexLast;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexLast;
}, function () {
  return Data_Traversable.traversableLast;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableLast)(dictApplicative)(f(Data_Unit.unit));
  };
});
var traversableWithIndexFirst = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexFirst;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexFirst;
}, function () {
  return Data_Traversable.traversableFirst;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableFirst)(dictApplicative)(f(Data_Unit.unit));
  };
});
var traversableWithIndexDual = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexDual;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexDual;
}, function () {
  return Data_Traversable.traversableDual;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableDual)(dictApplicative)(f(Data_Unit.unit));
  };
});
var traversableWithIndexDisj = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexDisj;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexDisj;
}, function () {
  return Data_Traversable.traversableDisj;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableDisj)(dictApplicative)(f(Data_Unit.unit));
  };
});
var traversableWithIndexConj = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexConj;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexConj;
}, function () {
  return Data_Traversable.traversableConj;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableConj)(dictApplicative)(f(Data_Unit.unit));
  };
});
var traversableWithIndexArray = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexArray;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexArray;
}, function () {
  return Data_Traversable.traversableArray;
}, function (dictApplicative) {
  return traverseWithIndexDefault(traversableWithIndexArray)(dictApplicative);
});
var traversableWithIndexAdditive = new TraversableWithIndex(function () {
  return Data_FoldableWithIndex.foldableWithIndexAdditive;
}, function () {
  return Data_FunctorWithIndex.functorWithIndexAdditive;
}, function () {
  return Data_Traversable.traversableAdditive;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(Data_Traversable.traversableAdditive)(dictApplicative)(f(Data_Unit.unit));
  };
});

var mapAccumRWithIndex = function mapAccumRWithIndex(dictTraversableWithIndex) {
  return function (f) {
    return function (s0) {
      return function (xs) {
        return Data_Traversable_Accum_Internal.stateR(traverseWithIndex(dictTraversableWithIndex)(Data_Traversable_Accum_Internal.applicativeStateR)(function (i) {
          return function (a) {
            return function (s) {
              return f(i)(s)(a);
            };
          };
        })(xs))(s0);
      };
    };
  };
};

var scanrWithIndex = function scanrWithIndex(dictTraversableWithIndex) {
  return function (f) {
    return function (b0) {
      return function (xs) {
        return mapAccumRWithIndex(dictTraversableWithIndex)(function (i) {
          return function (b) {
            return function (a) {
              var b$prime = f(i)(a)(b);
              return {
                accum: b$prime,
                value: b$prime
              };
            };
          };
        })(b0)(xs).value;
      };
    };
  };
};

var mapAccumLWithIndex = function mapAccumLWithIndex(dictTraversableWithIndex) {
  return function (f) {
    return function (s0) {
      return function (xs) {
        return Data_Traversable_Accum_Internal.stateL(traverseWithIndex(dictTraversableWithIndex)(Data_Traversable_Accum_Internal.applicativeStateL)(function (i) {
          return function (a) {
            return function (s) {
              return f(i)(s)(a);
            };
          };
        })(xs))(s0);
      };
    };
  };
};

var scanlWithIndex = function scanlWithIndex(dictTraversableWithIndex) {
  return function (f) {
    return function (b0) {
      return function (xs) {
        return mapAccumLWithIndex(dictTraversableWithIndex)(function (i) {
          return function (b) {
            return function (a) {
              var b$prime = f(i)(b)(a);
              return {
                accum: b$prime,
                value: b$prime
              };
            };
          };
        })(b0)(xs).value;
      };
    };
  };
};

var forWithIndex = function forWithIndex(dictApplicative) {
  return function (dictTraversableWithIndex) {
    return Data_Function.flip(traverseWithIndex(dictTraversableWithIndex)(dictApplicative));
  };
};

module.exports = {
  TraversableWithIndex: TraversableWithIndex,
  traverseWithIndex: traverseWithIndex,
  traverseWithIndexDefault: traverseWithIndexDefault,
  forWithIndex: forWithIndex,
  scanlWithIndex: scanlWithIndex,
  mapAccumLWithIndex: mapAccumLWithIndex,
  scanrWithIndex: scanrWithIndex,
  mapAccumRWithIndex: mapAccumRWithIndex,
  traverseDefault: traverseDefault,
  traversableWithIndexArray: traversableWithIndexArray,
  traversableWithIndexMaybe: traversableWithIndexMaybe,
  traversableWithIndexFirst: traversableWithIndexFirst,
  traversableWithIndexLast: traversableWithIndexLast,
  traversableWithIndexAdditive: traversableWithIndexAdditive,
  traversableWithIndexDual: traversableWithIndexDual,
  traversableWithIndexConj: traversableWithIndexConj,
  traversableWithIndexDisj: traversableWithIndexDisj,
  traversableWithIndexMultiplicative: traversableWithIndexMultiplicative
};
},{"../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.Traversable.Accum.Internal/index.js":"../output/Data.Traversable.Accum.Internal/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Either/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Extend = require("../Control.Extend/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Bifoldable = require("../Data.Bifoldable/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Bitraversable = require("../Data.Bitraversable/index.js");

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Invariant = require("../Data.Functor.Invariant/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Left = function () {
  function Left(value0) {
    this.value0 = value0;
  }

  ;

  Left.create = function (value0) {
    return new Left(value0);
  };

  return Left;
}();

var Right = function () {
  function Right(value0) {
    this.value0 = value0;
  }

  ;

  Right.create = function (value0) {
    return new Right(value0);
  };

  return Right;
}();

var showEither = function showEither(dictShow) {
  return function (dictShow1) {
    return new Data_Show.Show(function (v) {
      if (v instanceof Left) {
        return "(Left " + (Data_Show.show(dictShow)(v.value0) + ")");
      }

      ;

      if (v instanceof Right) {
        return "(Right " + (Data_Show.show(dictShow1)(v.value0) + ")");
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 163, column 1 - line 165, column 46): " + [v.constructor.name]);
    });
  };
};

var note$prime = function note$prime(f) {
  return Data_Maybe["maybe'"](function ($198) {
    return Left.create(f($198));
  })(Right.create);
};

var note = function note(a) {
  return Data_Maybe.maybe(new Left(a))(Right.create);
};

var functorEither = new Data_Functor.Functor(function (f) {
  return function (m) {
    if (m instanceof Left) {
      return new Left(m.value0);
    }

    ;

    if (m instanceof Right) {
      return new Right(f(m.value0));
    }

    ;
    throw new Error("Failed pattern match at Data.Either (line 38, column 1 - line 38, column 52): " + [m.constructor.name]);
  };
});
var functorWithIndexEither = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorEither;
}, function (f) {
  return Data_Functor.map(functorEither)(f(Data_Unit.unit));
});
var invariantEither = new Data_Functor_Invariant.Invariant(Data_Functor_Invariant.imapF(functorEither));

var fromRight = function fromRight(dictPartial) {
  return function (v) {
    if (v instanceof Right) {
      return v.value0;
    }

    ;
    throw new Error("Failed pattern match at Data.Either (line 261, column 1 - line 261, column 52): " + [v.constructor.name]);
  };
};

var fromLeft = function fromLeft(dictPartial) {
  return function (v) {
    if (v instanceof Left) {
      return v.value0;
    }

    ;
    throw new Error("Failed pattern match at Data.Either (line 256, column 1 - line 256, column 51): " + [v.constructor.name]);
  };
};

var foldableEither = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      if (v instanceof Left) {
        return Data_Monoid.mempty(dictMonoid);
      }

      ;

      if (v instanceof Right) {
        return f(v.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 187, column 1 - line 193, column 28): " + [f.constructor.name, v.constructor.name]);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      if (v1 instanceof Left) {
        return z;
      }

      ;

      if (v1 instanceof Right) {
        return v(z)(v1.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 187, column 1 - line 193, column 28): " + [v.constructor.name, z.constructor.name, v1.constructor.name]);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      if (v1 instanceof Left) {
        return z;
      }

      ;

      if (v1 instanceof Right) {
        return v(v1.value0)(z);
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 187, column 1 - line 193, column 28): " + [v.constructor.name, z.constructor.name, v1.constructor.name]);
    };
  };
});
var foldableWithIndexEither = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableEither;
}, function (dictMonoid) {
  return function (f) {
    return function (v) {
      if (v instanceof Left) {
        return Data_Monoid.mempty(dictMonoid);
      }

      ;

      if (v instanceof Right) {
        return f(Data_Unit.unit)(v.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 195, column 1 - line 201, column 42): " + [f.constructor.name, v.constructor.name]);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      if (v1 instanceof Left) {
        return z;
      }

      ;

      if (v1 instanceof Right) {
        return v(Data_Unit.unit)(z)(v1.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 195, column 1 - line 201, column 42): " + [v.constructor.name, z.constructor.name, v1.constructor.name]);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      if (v1 instanceof Left) {
        return z;
      }

      ;

      if (v1 instanceof Right) {
        return v(Data_Unit.unit)(v1.value0)(z);
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 195, column 1 - line 201, column 42): " + [v.constructor.name, z.constructor.name, v1.constructor.name]);
    };
  };
});
var traversableEither = new Data_Traversable.Traversable(function () {
  return foldableEither;
}, function () {
  return functorEither;
}, function (dictApplicative) {
  return function (v) {
    if (v instanceof Left) {
      return Control_Applicative.pure(dictApplicative)(new Left(v.value0));
    }

    ;

    if (v instanceof Right) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Right.create)(v.value0);
    }

    ;
    throw new Error("Failed pattern match at Data.Either (line 211, column 1 - line 215, column 36): " + [v.constructor.name]);
  };
}, function (dictApplicative) {
  return function (v) {
    return function (v1) {
      if (v1 instanceof Left) {
        return Control_Applicative.pure(dictApplicative)(new Left(v1.value0));
      }

      ;

      if (v1 instanceof Right) {
        return Data_Functor.map(dictApplicative.Apply0().Functor0())(Right.create)(v(v1.value0));
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 211, column 1 - line 215, column 36): " + [v.constructor.name, v1.constructor.name]);
    };
  };
});
var traversableWithIndexEither = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexEither;
}, function () {
  return functorWithIndexEither;
}, function () {
  return traversableEither;
}, function (dictApplicative) {
  return function (v) {
    return function (v1) {
      if (v1 instanceof Left) {
        return Control_Applicative.pure(dictApplicative)(new Left(v1.value0));
      }

      ;

      if (v1 instanceof Right) {
        return Data_Functor.map(dictApplicative.Apply0().Functor0())(Right.create)(v(Data_Unit.unit)(v1.value0));
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 217, column 1 - line 219, column 53): " + [v.constructor.name, v1.constructor.name]);
    };
  };
});
var extendEither = new Control_Extend.Extend(function () {
  return functorEither;
}, function (v) {
  return function (v1) {
    if (v1 instanceof Left) {
      return new Left(v1.value0);
    }

    ;
    return new Right(v(v1));
  };
});

var eqEither = function eqEither(dictEq) {
  return function (dictEq1) {
    return new Data_Eq.Eq(function (x) {
      return function (y) {
        if (x instanceof Left && y instanceof Left) {
          return Data_Eq.eq(dictEq)(x.value0)(y.value0);
        }

        ;

        if (x instanceof Right && y instanceof Right) {
          return Data_Eq.eq(dictEq1)(x.value0)(y.value0);
        }

        ;
        return false;
      };
    });
  };
};

var ordEither = function ordEither(dictOrd) {
  return function (dictOrd1) {
    return new Data_Ord.Ord(function () {
      return eqEither(dictOrd.Eq0())(dictOrd1.Eq0());
    }, function (x) {
      return function (y) {
        if (x instanceof Left && y instanceof Left) {
          return Data_Ord.compare(dictOrd)(x.value0)(y.value0);
        }

        ;

        if (x instanceof Left) {
          return Data_Ordering.LT.value;
        }

        ;

        if (y instanceof Left) {
          return Data_Ordering.GT.value;
        }

        ;

        if (x instanceof Right && y instanceof Right) {
          return Data_Ord.compare(dictOrd1)(x.value0)(y.value0);
        }

        ;
        throw new Error("Failed pattern match at Data.Either (line 179, column 1 - line 179, column 64): " + [x.constructor.name, y.constructor.name]);
      };
    });
  };
};

var eq1Either = function eq1Either(dictEq) {
  return new Data_Eq.Eq1(function (dictEq1) {
    return Data_Eq.eq(eqEither(dictEq)(dictEq1));
  });
};

var ord1Either = function ord1Either(dictOrd) {
  return new Data_Ord.Ord1(function () {
    return eq1Either(dictOrd.Eq0());
  }, function (dictOrd1) {
    return Data_Ord.compare(ordEither(dictOrd)(dictOrd1));
  });
};

var either = function either(v) {
  return function (v1) {
    return function (v2) {
      if (v2 instanceof Left) {
        return v(v2.value0);
      }

      ;

      if (v2 instanceof Right) {
        return v1(v2.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 238, column 1 - line 238, column 64): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
    };
  };
};

var hush = either(Data_Function["const"](Data_Maybe.Nothing.value))(Data_Maybe.Just.create);
var isLeft = either(Data_Function["const"](true))(Data_Function["const"](false));
var isRight = either(Data_Function["const"](false))(Data_Function["const"](true));

var choose = function choose(dictAlt) {
  return function (a) {
    return function (b) {
      return Control_Alt.alt(dictAlt)(Data_Functor.map(dictAlt.Functor0())(Left.create)(a))(Data_Functor.map(dictAlt.Functor0())(Right.create)(b));
    };
  };
};

var boundedEither = function boundedEither(dictBounded) {
  return function (dictBounded1) {
    return new Data_Bounded.Bounded(function () {
      return ordEither(dictBounded.Ord0())(dictBounded1.Ord0());
    }, new Left(Data_Bounded.bottom(dictBounded)), new Right(Data_Bounded.top(dictBounded1)));
  };
};

var bifunctorEither = new Data_Bifunctor.Bifunctor(function (v) {
  return function (v1) {
    return function (v2) {
      if (v2 instanceof Left) {
        return new Left(v(v2.value0));
      }

      ;

      if (v2 instanceof Right) {
        return new Right(v1(v2.value0));
      }

      ;
      throw new Error("Failed pattern match at Data.Either (line 46, column 1 - line 48, column 36): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
    };
  };
});
var bifoldableEither = new Data_Bifoldable.Bifoldable(function (dictMonoid) {
  return function (v) {
    return function (v1) {
      return function (v2) {
        if (v2 instanceof Left) {
          return v(v2.value0);
        }

        ;

        if (v2 instanceof Right) {
          return v1(v2.value0);
        }

        ;
        throw new Error("Failed pattern match at Data.Either (line 203, column 1 - line 209, column 32): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
      };
    };
  };
}, function (v) {
  return function (v1) {
    return function (z) {
      return function (v2) {
        if (v2 instanceof Left) {
          return v(z)(v2.value0);
        }

        ;

        if (v2 instanceof Right) {
          return v1(z)(v2.value0);
        }

        ;
        throw new Error("Failed pattern match at Data.Either (line 203, column 1 - line 209, column 32): " + [v.constructor.name, v1.constructor.name, z.constructor.name, v2.constructor.name]);
      };
    };
  };
}, function (v) {
  return function (v1) {
    return function (z) {
      return function (v2) {
        if (v2 instanceof Left) {
          return v(v2.value0)(z);
        }

        ;

        if (v2 instanceof Right) {
          return v1(v2.value0)(z);
        }

        ;
        throw new Error("Failed pattern match at Data.Either (line 203, column 1 - line 209, column 32): " + [v.constructor.name, v1.constructor.name, z.constructor.name, v2.constructor.name]);
      };
    };
  };
});
var bitraversableEither = new Data_Bitraversable.Bitraversable(function () {
  return bifoldableEither;
}, function () {
  return bifunctorEither;
}, function (dictApplicative) {
  return function (v) {
    if (v instanceof Left) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Left.create)(v.value0);
    }

    ;

    if (v instanceof Right) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Right.create)(v.value0);
    }

    ;
    throw new Error("Failed pattern match at Data.Either (line 221, column 1 - line 225, column 37): " + [v.constructor.name]);
  };
}, function (dictApplicative) {
  return function (v) {
    return function (v1) {
      return function (v2) {
        if (v2 instanceof Left) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Left.create)(v(v2.value0));
        }

        ;

        if (v2 instanceof Right) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Right.create)(v1(v2.value0));
        }

        ;
        throw new Error("Failed pattern match at Data.Either (line 221, column 1 - line 225, column 37): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
      };
    };
  };
});
var applyEither = new Control_Apply.Apply(function () {
  return functorEither;
}, function (v) {
  return function (v1) {
    if (v instanceof Left) {
      return new Left(v.value0);
    }

    ;

    if (v instanceof Right) {
      return Data_Functor.map(functorEither)(v.value0)(v1);
    }

    ;
    throw new Error("Failed pattern match at Data.Either (line 82, column 1 - line 84, column 30): " + [v.constructor.name, v1.constructor.name]);
  };
});
var bindEither = new Control_Bind.Bind(function () {
  return applyEither;
}, either(function (e) {
  return function (v) {
    return new Left(e);
  };
})(function (a) {
  return function (f) {
    return f(a);
  };
}));

var semigroupEither = function semigroupEither(dictSemigroup) {
  return new Data_Semigroup.Semigroup(function (x) {
    return function (y) {
      return Control_Apply.apply(applyEither)(Data_Functor.map(functorEither)(Data_Semigroup.append(dictSemigroup))(x))(y);
    };
  });
};

var applicativeEither = new Control_Applicative.Applicative(function () {
  return applyEither;
}, Right.create);
var monadEither = new Control_Monad.Monad(function () {
  return applicativeEither;
}, function () {
  return bindEither;
});
var altEither = new Control_Alt.Alt(function () {
  return functorEither;
}, function (v) {
  return function (v1) {
    if (v instanceof Left) {
      return v1;
    }

    ;
    return v;
  };
});
module.exports = {
  Left: Left,
  Right: Right,
  either: either,
  choose: choose,
  isLeft: isLeft,
  isRight: isRight,
  fromLeft: fromLeft,
  fromRight: fromRight,
  note: note,
  "note'": note$prime,
  hush: hush,
  functorEither: functorEither,
  functorWithIndexEither: functorWithIndexEither,
  invariantEither: invariantEither,
  bifunctorEither: bifunctorEither,
  applyEither: applyEither,
  applicativeEither: applicativeEither,
  altEither: altEither,
  bindEither: bindEither,
  monadEither: monadEither,
  extendEither: extendEither,
  showEither: showEither,
  eqEither: eqEither,
  eq1Either: eq1Either,
  ordEither: ordEither,
  ord1Either: ord1Either,
  boundedEither: boundedEither,
  foldableEither: foldableEither,
  foldableWithIndexEither: foldableWithIndexEither,
  bifoldableEither: bifoldableEither,
  traversableEither: traversableEither,
  traversableWithIndexEither: traversableWithIndexEither,
  bitraversableEither: bitraversableEither,
  semigroupEither: semigroupEither
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Extend/index.js":"../output/Control.Extend/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Bifoldable/index.js":"../output/Data.Bifoldable/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Bitraversable/index.js":"../output/Data.Bitraversable/index.js","../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Invariant/index.js":"../output/Data.Functor.Invariant/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Effect/foreign.js":[function(require,module,exports) {
"use strict";

exports.pureE = function (a) {
  return function () {
    return a;
  };
};

exports.bindE = function (a) {
  return function (f) {
    return function () {
      return f(a())();
    };
  };
};

exports.untilE = function (f) {
  return function () {
    while (!f()) {
      ;
    }

    return {};
  };
};

exports.whileE = function (f) {
  return function (a) {
    return function () {
      while (f()) {
        a();
      }

      return {};
    };
  };
};

exports.forE = function (lo) {
  return function (hi) {
    return function (f) {
      return function () {
        for (var i = lo; i < hi; i++) {
          f(i)();
        }
      };
    };
  };
};

exports.foreachE = function (as) {
  return function (f) {
    return function () {
      for (var i = 0, l = as.length; i < l; i++) {
        f(as[i])();
      }
    };
  };
};
},{}],"../output/Effect/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var monadEffect = new Control_Monad.Monad(function () {
  return applicativeEffect;
}, function () {
  return bindEffect;
});
var bindEffect = new Control_Bind.Bind(function () {
  return applyEffect;
}, $foreign.bindE);
var applyEffect = new Control_Apply.Apply(function () {
  return functorEffect;
}, Control_Monad.ap(monadEffect));
var applicativeEffect = new Control_Applicative.Applicative(function () {
  return applyEffect;
}, $foreign.pureE);
var functorEffect = new Data_Functor.Functor(Control_Applicative.liftA1(applicativeEffect));

var semigroupEffect = function semigroupEffect(dictSemigroup) {
  return new Data_Semigroup.Semigroup(Control_Apply.lift2(applyEffect)(Data_Semigroup.append(dictSemigroup)));
};

var monoidEffect = function monoidEffect(dictMonoid) {
  return new Data_Monoid.Monoid(function () {
    return semigroupEffect(dictMonoid.Semigroup0());
  }, $foreign.pureE(Data_Monoid.mempty(dictMonoid)));
};

module.exports = {
  functorEffect: functorEffect,
  applyEffect: applyEffect,
  applicativeEffect: applicativeEffect,
  bindEffect: bindEffect,
  monadEffect: monadEffect,
  semigroupEffect: semigroupEffect,
  monoidEffect: monoidEffect,
  untilE: $foreign.untilE,
  whileE: $foreign.whileE,
  forE: $foreign.forE,
  foreachE: $foreign.foreachE
};
},{"./foreign.js":"../output/Effect/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js"}],"../output/Effect.Exception/foreign.js":[function(require,module,exports) {
"use strict";

exports.showErrorImpl = function (err) {
  return err.stack || err.toString();
};

exports.error = function (msg) {
  return new Error(msg);
};

exports.message = function (e) {
  return e.message;
};

exports.name = function (e) {
  return e.name || "Error";
};

exports.stackImpl = function (just) {
  return function (nothing) {
    return function (e) {
      return e.stack ? just(e.stack) : nothing;
    };
  };
};

exports.throwException = function (e) {
  return function () {
    throw e;
  };
};

exports.catchException = function (c) {
  return function (t) {
    return function () {
      try {
        return t();
      } catch (e) {
        if (e instanceof Error || Object.prototype.toString.call(e) === "[object Error]") {
          return c(e)();
        } else {
          return c(new Error(e.toString()))();
        }
      }
    };
  };
};
},{}],"../output/Effect.Exception/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Show = require("../Data.Show/index.js");

var Effect = require("../Effect/index.js");

var $$try = function $$try(action) {
  return $foreign.catchException(function () {
    var $0 = Control_Applicative.pure(Effect.applicativeEffect);
    return function ($1) {
      return $0(Data_Either.Left.create($1));
    };
  }())(Data_Functor.map(Effect.functorEffect)(Data_Either.Right.create)(action));
};

var $$throw = function $$throw($2) {
  return $foreign.throwException($foreign.error($2));
};

var stack = $foreign.stackImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
var showError = new Data_Show.Show($foreign.showErrorImpl);
module.exports = {
  stack: stack,
  "throw": $$throw,
  "try": $$try,
  showError: showError,
  error: $foreign.error,
  message: $foreign.message,
  name: $foreign.name,
  throwException: $foreign.throwException,
  catchException: $foreign.catchException
};
},{"./foreign.js":"../output/Effect.Exception/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Effect/index.js":"../output/Effect/index.js"}],"../output/Control.Monad.Error.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Effect = require("../Effect/index.js");

var Effect_Exception = require("../Effect.Exception/index.js");

var MonadThrow = function MonadThrow(Monad0, throwError) {
  this.Monad0 = Monad0;
  this.throwError = throwError;
};

var MonadError = function MonadError(MonadThrow0, catchError) {
  this.MonadThrow0 = MonadThrow0;
  this.catchError = catchError;
};

var throwError = function throwError(dict) {
  return dict.throwError;
};

var monadThrowMaybe = new MonadThrow(function () {
  return Data_Maybe.monadMaybe;
}, Data_Function["const"](Data_Maybe.Nothing.value));
var monadThrowEither = new MonadThrow(function () {
  return Data_Either.monadEither;
}, Data_Either.Left.create);
var monadThrowEffect = new MonadThrow(function () {
  return Effect.monadEffect;
}, Effect_Exception.throwException);
var monadErrorMaybe = new MonadError(function () {
  return monadThrowMaybe;
}, function (v) {
  return function (v1) {
    if (v instanceof Data_Maybe.Nothing) {
      return v1(Data_Unit.unit);
    }

    ;

    if (v instanceof Data_Maybe.Just) {
      return new Data_Maybe.Just(v.value0);
    }

    ;
    throw new Error("Failed pattern match at Control.Monad.Error.Class (line 79, column 1 - line 81, column 33): " + [v.constructor.name, v1.constructor.name]);
  };
});
var monadErrorEither = new MonadError(function () {
  return monadThrowEither;
}, function (v) {
  return function (v1) {
    if (v instanceof Data_Either.Left) {
      return v1(v.value0);
    }

    ;

    if (v instanceof Data_Either.Right) {
      return new Data_Either.Right(v.value0);
    }

    ;
    throw new Error("Failed pattern match at Control.Monad.Error.Class (line 72, column 1 - line 74, column 35): " + [v.constructor.name, v1.constructor.name]);
  };
});
var monadErrorEffect = new MonadError(function () {
  return monadThrowEffect;
}, Data_Function.flip(Effect_Exception.catchException));

var catchError = function catchError(dict) {
  return dict.catchError;
};

var catchJust = function catchJust(dictMonadError) {
  return function (p) {
    return function (act) {
      return function (handler) {
        var handle = function handle(e) {
          var v = p(e);

          if (v instanceof Data_Maybe.Nothing) {
            return throwError(dictMonadError.MonadThrow0())(e);
          }

          ;

          if (v instanceof Data_Maybe.Just) {
            return handler(v.value0);
          }

          ;
          throw new Error("Failed pattern match at Control.Monad.Error.Class (line 57, column 5 - line 59, column 26): " + [v.constructor.name]);
        };

        return catchError(dictMonadError)(act)(handle);
      };
    };
  };
};

var $$try = function $$try(dictMonadError) {
  return function (a) {
    return catchError(dictMonadError)(Data_Functor.map(dictMonadError.MonadThrow0().Monad0().Bind1().Apply0().Functor0())(Data_Either.Right.create)(a))(function () {
      var $17 = Control_Applicative.pure(dictMonadError.MonadThrow0().Monad0().Applicative0());
      return function ($18) {
        return $17(Data_Either.Left.create($18));
      };
    }());
  };
};

var withResource = function withResource(dictMonadError) {
  return function (acquire) {
    return function (release) {
      return function (kleisli) {
        return Control_Bind.bind(dictMonadError.MonadThrow0().Monad0().Bind1())(acquire)(function (resource) {
          return Control_Bind.bind(dictMonadError.MonadThrow0().Monad0().Bind1())($$try(dictMonadError)(kleisli(resource)))(function (result) {
            return Control_Bind.discard(Control_Bind.discardUnit)(dictMonadError.MonadThrow0().Monad0().Bind1())(release(resource))(function () {
              return Data_Either.either(throwError(dictMonadError.MonadThrow0()))(Control_Applicative.pure(dictMonadError.MonadThrow0().Monad0().Applicative0()))(result);
            });
          });
        });
      };
    };
  };
};

module.exports = {
  catchError: catchError,
  throwError: throwError,
  MonadThrow: MonadThrow,
  MonadError: MonadError,
  catchJust: catchJust,
  "try": $$try,
  withResource: withResource,
  monadThrowEither: monadThrowEither,
  monadErrorEither: monadErrorEither,
  monadThrowMaybe: monadThrowMaybe,
  monadErrorMaybe: monadErrorMaybe,
  monadThrowEffect: monadThrowEffect,
  monadErrorEffect: monadErrorEffect
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Effect/index.js":"../output/Effect/index.js","../Effect.Exception/index.js":"../output/Effect.Exception/index.js"}],"../output/Control.Monad.Reader.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var MonadAsk = function MonadAsk(Monad0, ask) {
  this.Monad0 = Monad0;
  this.ask = ask;
};

var MonadReader = function MonadReader(MonadAsk0, local) {
  this.MonadAsk0 = MonadAsk0;
  this.local = local;
};

var monadAskFun = new MonadAsk(function () {
  return Control_Monad.monadFn;
}, Control_Category.identity(Control_Category.categoryFn));
var monadReaderFun = new MonadReader(function () {
  return monadAskFun;
}, Control_Semigroupoid.composeFlipped(Control_Semigroupoid.semigroupoidFn));

var local = function local(dict) {
  return dict.local;
};

var ask = function ask(dict) {
  return dict.ask;
};

var asks = function asks(dictMonadAsk) {
  return function (f) {
    return Data_Functor.map(dictMonadAsk.Monad0().Bind1().Apply0().Functor0())(f)(ask(dictMonadAsk));
  };
};

module.exports = {
  ask: ask,
  local: local,
  MonadAsk: MonadAsk,
  asks: asks,
  MonadReader: MonadReader,
  monadAskFun: monadAskFun,
  monadReaderFun: monadReaderFun
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js"}],"../output/Control.Comonad/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Comonad = function Comonad(Extend0, extract) {
  this.Extend0 = Extend0;
  this.extract = extract;
};

var extract = function extract(dict) {
  return dict.extract;
};

module.exports = {
  Comonad: Comonad,
  extract: extract
};
},{}],"../output/Data.Ord.Max/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Max = function Max(x) {
  return x;
};

var showMax = function showMax(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Max " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupMax = function semigroupMax(dictOrd) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Data_Ord.max(dictOrd)(v)(v1);
    };
  });
};

var newtypeMax = new Data_Newtype.Newtype(function (n) {
  return n;
}, Max);

var monoidMax = function monoidMax(dictBounded) {
  return new Data_Monoid.Monoid(function () {
    return semigroupMax(dictBounded.Ord0());
  }, Data_Bounded.bottom(dictBounded));
};

var eqMax = function eqMax(dictEq) {
  return dictEq;
};

var ordMax = function ordMax(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqMax(dictOrd.Eq0());
  }, function (v) {
    return function (v1) {
      return Data_Ord.compare(dictOrd)(v)(v1);
    };
  });
};

module.exports = {
  Max: Max,
  newtypeMax: newtypeMax,
  eqMax: eqMax,
  ordMax: ordMax,
  semigroupMax: semigroupMax,
  monoidMax: monoidMax,
  showMax: showMax
};
},{"../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Ord.Min/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Min = function Min(x) {
  return x;
};

var showMin = function showMin(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Min " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupMin = function semigroupMin(dictOrd) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Data_Ord.min(dictOrd)(v)(v1);
    };
  });
};

var newtypeMin = new Data_Newtype.Newtype(function (n) {
  return n;
}, Min);

var monoidMin = function monoidMin(dictBounded) {
  return new Data_Monoid.Monoid(function () {
    return semigroupMin(dictBounded.Ord0());
  }, Data_Bounded.top(dictBounded));
};

var eqMin = function eqMin(dictEq) {
  return dictEq;
};

var ordMin = function ordMin(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqMin(dictOrd.Eq0());
  }, function (v) {
    return function (v1) {
      return Data_Ord.compare(dictOrd)(v)(v1);
    };
  });
};

module.exports = {
  Min: Min,
  newtypeMin: newtypeMin,
  eqMin: eqMin,
  ordMin: ordMin,
  semigroupMin: semigroupMin,
  monoidMin: monoidMin,
  showMin: showMin
};
},{"../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Data.Semigroup.Foldable/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord_Max = require("../Data.Ord.Max/index.js");

var Data_Ord_Min = require("../Data.Ord.Min/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var JoinWith = function JoinWith(x) {
  return x;
};

var Act = function Act(x) {
  return x;
};

var Foldable1 = function Foldable1(Foldable0, fold1, foldMap1) {
  this.Foldable0 = Foldable0;
  this.fold1 = fold1;
  this.foldMap1 = foldMap1;
};

var semigroupJoinWith = function semigroupJoinWith(dictSemigroup) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return JoinWith(function (j) {
        return Data_Semigroup.append(dictSemigroup)(v(j))(Data_Semigroup.append(dictSemigroup)(j)(v1(j)));
      });
    };
  });
};

var semigroupAct = function semigroupAct(dictApply) {
  return new Data_Semigroup.Semigroup(function (v) {
    return function (v1) {
      return Control_Apply.applySecond(dictApply)(v)(v1);
    };
  });
};

var joinee = function joinee(v) {
  return v;
};

var getAct = function getAct(v) {
  return v;
};

var foldMap1 = function foldMap1(dict) {
  return dict.foldMap1;
};

var intercalateMap = function intercalateMap(dictFoldable1) {
  return function (dictSemigroup) {
    return function (j) {
      return function (f) {
        return function (foldable) {
          return joinee(foldMap1(dictFoldable1)(semigroupJoinWith(dictSemigroup))(function ($43) {
            return JoinWith(Data_Function["const"](f($43)));
          })(foldable))(j);
        };
      };
    };
  };
};

var intercalate = function intercalate(dictFoldable1) {
  return function (dictSemigroup) {
    return Data_Function.flip(intercalateMap(dictFoldable1)(dictSemigroup))(Control_Category.identity(Control_Category.categoryFn));
  };
};

var maximum = function maximum(dictOrd) {
  return function (dictFoldable1) {
    return Data_Newtype.ala(Data_Functor.functorFn)(Data_Ord_Max.newtypeMax)(Data_Ord_Max.newtypeMax)(Data_Ord_Max.Max)(foldMap1(dictFoldable1)(Data_Ord_Max.semigroupMax(dictOrd)));
  };
};

var minimum = function minimum(dictOrd) {
  return function (dictFoldable1) {
    return Data_Newtype.ala(Data_Functor.functorFn)(Data_Ord_Min.newtypeMin)(Data_Ord_Min.newtypeMin)(Data_Ord_Min.Min)(foldMap1(dictFoldable1)(Data_Ord_Min.semigroupMin(dictOrd)));
  };
};

var traverse1_ = function traverse1_(dictFoldable1) {
  return function (dictApply) {
    return function (f) {
      return function (t) {
        return Data_Functor.voidRight(dictApply.Functor0())(Data_Unit.unit)(getAct(foldMap1(dictFoldable1)(semigroupAct(dictApply))(function ($44) {
          return Act(f($44));
        })(t)));
      };
    };
  };
};

var for1_ = function for1_(dictFoldable1) {
  return function (dictApply) {
    return Data_Function.flip(traverse1_(dictFoldable1)(dictApply));
  };
};

var sequence1_ = function sequence1_(dictFoldable1) {
  return function (dictApply) {
    return traverse1_(dictFoldable1)(dictApply)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var fold1Default = function fold1Default(dictFoldable1) {
  return function (dictSemigroup) {
    return foldMap1(dictFoldable1)(dictSemigroup)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var foldableDual = new Foldable1(function () {
  return Data_Foldable.foldableDual;
}, function (dictSemigroup) {
  return fold1Default(foldableDual)(dictSemigroup);
}, function (dictSemigroup) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
});
var foldableMultiplicative = new Foldable1(function () {
  return Data_Foldable.foldableMultiplicative;
}, function (dictSemigroup) {
  return fold1Default(foldableMultiplicative)(dictSemigroup);
}, function (dictSemigroup) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
});

var fold1 = function fold1(dict) {
  return dict.fold1;
};

var foldMap1Default = function foldMap1Default(dictFoldable1) {
  return function (dictFunctor) {
    return function (dictSemigroup) {
      return function (f) {
        var $45 = fold1(dictFoldable1)(dictSemigroup);
        var $46 = Data_Functor.map(dictFunctor)(f);
        return function ($47) {
          return $45($46($47));
        };
      };
    };
  };
};

module.exports = {
  Foldable1: Foldable1,
  foldMap1: foldMap1,
  fold1: fold1,
  traverse1_: traverse1_,
  for1_: for1_,
  sequence1_: sequence1_,
  foldMap1Default: foldMap1Default,
  fold1Default: fold1Default,
  intercalate: intercalate,
  intercalateMap: intercalateMap,
  maximum: maximum,
  minimum: minimum,
  foldableDual: foldableDual,
  foldableMultiplicative: foldableMultiplicative
};
},{"../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord.Max/index.js":"../output/Data.Ord.Max/index.js","../Data.Ord.Min/index.js":"../output/Data.Ord.Min/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Semigroup.Traversable/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid_Dual = require("../Data.Monoid.Dual/index.js");

var Data_Monoid_Multiplicative = require("../Data.Monoid.Multiplicative/index.js");

var Data_Semigroup_Foldable = require("../Data.Semigroup.Foldable/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Traversable1 = function Traversable1(Foldable10, _Traversable, sequence1, traverse1) {
  this.Foldable10 = Foldable10;
  this.Traversable1 = _Traversable;
  this.sequence1 = sequence1;
  this.traverse1 = traverse1;
};

var traverse1 = function traverse1(dict) {
  return dict.traverse1;
};

var sequence1Default = function sequence1Default(dictTraversable1) {
  return function (dictApply) {
    return traverse1(dictTraversable1)(dictApply)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var traversableDual = new Traversable1(function () {
  return Data_Semigroup_Foldable.foldableDual;
}, function () {
  return Data_Traversable.traversableDual;
}, function (dictApply) {
  return sequence1Default(traversableDual)(dictApply);
}, function (dictApply) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApply.Functor0())(Data_Monoid_Dual.Dual)(f(v));
    };
  };
});
var traversableMultiplicative = new Traversable1(function () {
  return Data_Semigroup_Foldable.foldableMultiplicative;
}, function () {
  return Data_Traversable.traversableMultiplicative;
}, function (dictApply) {
  return sequence1Default(traversableMultiplicative)(dictApply);
}, function (dictApply) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApply.Functor0())(Data_Monoid_Multiplicative.Multiplicative)(f(v));
    };
  };
});

var sequence1 = function sequence1(dict) {
  return dict.sequence1;
};

var traverse1Default = function traverse1Default(dictTraversable1) {
  return function (dictApply) {
    return function (f) {
      return function (ta) {
        return sequence1(dictTraversable1)(dictApply)(Data_Functor.map(dictTraversable1.Traversable1().Functor0())(f)(ta));
      };
    };
  };
};

module.exports = {
  sequence1: sequence1,
  traverse1: traverse1,
  Traversable1: Traversable1,
  traverse1Default: traverse1Default,
  sequence1Default: sequence1Default,
  traversableDual: traversableDual,
  traversableMultiplicative: traversableMultiplicative
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid.Dual/index.js":"../output/Data.Monoid.Dual/index.js","../Data.Monoid.Multiplicative/index.js":"../output/Data.Monoid.Multiplicative/index.js","../Data.Semigroup.Foldable/index.js":"../output/Data.Semigroup.Foldable/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js"}],"../output/Data.Identity/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Comonad = require("../Control.Comonad/index.js");

var Control_Extend = require("../Control.Extend/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Invariant = require("../Data.Functor.Invariant/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup_Foldable = require("../Data.Semigroup.Foldable/index.js");

var Data_Semigroup_Traversable = require("../Data.Semigroup.Traversable/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Identity = function Identity(x) {
  return x;
};

var showIdentity = function showIdentity(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Identity " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semiringIdentity = function semiringIdentity(dictSemiring) {
  return dictSemiring;
};

var semigroupIdenity = function semigroupIdenity(dictSemigroup) {
  return dictSemigroup;
};

var ringIdentity = function ringIdentity(dictRing) {
  return dictRing;
};

var ordIdentity = function ordIdentity(dictOrd) {
  return dictOrd;
};

var newtypeIdentity = new Data_Newtype.Newtype(function (n) {
  return n;
}, Identity);

var monoidIdentity = function monoidIdentity(dictMonoid) {
  return dictMonoid;
};

var lazyIdentity = function lazyIdentity(dictLazy) {
  return dictLazy;
};

var heytingAlgebraIdentity = function heytingAlgebraIdentity(dictHeytingAlgebra) {
  return dictHeytingAlgebra;
};

var functorIdentity = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});
var functorWithIndexIdentity = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorIdentity;
}, function (f) {
  return function (v) {
    return f(Data_Unit.unit)(v);
  };
});
var invariantIdentity = new Data_Functor_Invariant.Invariant(Data_Functor_Invariant.imapF(functorIdentity));
var foldableIdentity = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(v)(z);
    };
  };
});
var foldableWithIndexIdentity = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableIdentity;
}, function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(Data_Unit.unit)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(Data_Unit.unit)(z)(v);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(Data_Unit.unit)(v)(z);
    };
  };
});
var traversableIdentity = new Data_Traversable.Traversable(function () {
  return foldableIdentity;
}, function () {
  return functorIdentity;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Identity)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Identity)(f(v));
    };
  };
});
var traversableWithIndexIdentity = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexIdentity;
}, function () {
  return functorWithIndexIdentity;
}, function () {
  return traversableIdentity;
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Identity)(f(Data_Unit.unit)(v));
    };
  };
});
var foldable1Identity = new Data_Semigroup_Foldable.Foldable1(function () {
  return foldableIdentity;
}, function (dictSemigroup) {
  return function (v) {
    return v;
  };
}, function (dictSemigroup) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
});
var traversable1Identity = new Data_Semigroup_Traversable.Traversable1(function () {
  return foldable1Identity;
}, function () {
  return traversableIdentity;
}, function (dictApply) {
  return function (v) {
    return Data_Functor.map(dictApply.Functor0())(Identity)(v);
  };
}, function (dictApply) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApply.Functor0())(Identity)(f(v));
    };
  };
});
var extendIdentity = new Control_Extend.Extend(function () {
  return functorIdentity;
}, function (f) {
  return function (m) {
    return f(m);
  };
});

var euclideanRingIdentity = function euclideanRingIdentity(dictEuclideanRing) {
  return dictEuclideanRing;
};

var eqIdentity = function eqIdentity(dictEq) {
  return dictEq;
};

var eq1Identity = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqIdentity(dictEq));
});
var ord1Identity = new Data_Ord.Ord1(function () {
  return eq1Identity;
}, function (dictOrd) {
  return Data_Ord.compare(ordIdentity(dictOrd));
});
var comonadIdentity = new Control_Comonad.Comonad(function () {
  return extendIdentity;
}, function (v) {
  return v;
});

var commutativeRingIdentity = function commutativeRingIdentity(dictCommutativeRing) {
  return dictCommutativeRing;
};

var boundedIdentity = function boundedIdentity(dictBounded) {
  return dictBounded;
};

var booleanAlgebraIdentity = function booleanAlgebraIdentity(dictBooleanAlgebra) {
  return dictBooleanAlgebra;
};

var applyIdentity = new Control_Apply.Apply(function () {
  return functorIdentity;
}, function (v) {
  return function (v1) {
    return v(v1);
  };
});
var bindIdentity = new Control_Bind.Bind(function () {
  return applyIdentity;
}, function (v) {
  return function (f) {
    return f(v);
  };
});
var applicativeIdentity = new Control_Applicative.Applicative(function () {
  return applyIdentity;
}, Identity);
var monadIdentity = new Control_Monad.Monad(function () {
  return applicativeIdentity;
}, function () {
  return bindIdentity;
});
var altIdentity = new Control_Alt.Alt(function () {
  return functorIdentity;
}, function (x) {
  return function (v) {
    return x;
  };
});
module.exports = {
  Identity: Identity,
  newtypeIdentity: newtypeIdentity,
  eqIdentity: eqIdentity,
  ordIdentity: ordIdentity,
  boundedIdentity: boundedIdentity,
  heytingAlgebraIdentity: heytingAlgebraIdentity,
  booleanAlgebraIdentity: booleanAlgebraIdentity,
  semigroupIdenity: semigroupIdenity,
  monoidIdentity: monoidIdentity,
  semiringIdentity: semiringIdentity,
  euclideanRingIdentity: euclideanRingIdentity,
  ringIdentity: ringIdentity,
  commutativeRingIdentity: commutativeRingIdentity,
  lazyIdentity: lazyIdentity,
  showIdentity: showIdentity,
  eq1Identity: eq1Identity,
  ord1Identity: ord1Identity,
  functorIdentity: functorIdentity,
  functorWithIndexIdentity: functorWithIndexIdentity,
  invariantIdentity: invariantIdentity,
  altIdentity: altIdentity,
  applyIdentity: applyIdentity,
  applicativeIdentity: applicativeIdentity,
  bindIdentity: bindIdentity,
  monadIdentity: monadIdentity,
  extendIdentity: extendIdentity,
  comonadIdentity: comonadIdentity,
  foldableIdentity: foldableIdentity,
  foldable1Identity: foldable1Identity,
  foldableWithIndexIdentity: foldableWithIndexIdentity,
  traversableIdentity: traversableIdentity,
  traversable1Identity: traversable1Identity,
  traversableWithIndexIdentity: traversableWithIndexIdentity
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Comonad/index.js":"../output/Control.Comonad/index.js","../Control.Extend/index.js":"../output/Control.Extend/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Invariant/index.js":"../output/Data.Functor.Invariant/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup.Foldable/index.js":"../output/Data.Semigroup.Foldable/index.js","../Data.Semigroup.Traversable/index.js":"../output/Data.Semigroup.Traversable/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Effect.Ref/foreign.js":[function(require,module,exports) {
"use strict";

exports.new = function (val) {
  return function () {
    return {
      value: val
    };
  };
};

exports.read = function (ref) {
  return function () {
    return ref.value;
  };
};

exports["modify'"] = function (f) {
  return function (ref) {
    return function () {
      var t = f(ref.value);
      ref.value = t.state;
      return t.value;
    };
  };
};

exports.write = function (val) {
  return function (ref) {
    return function () {
      ref.value = val;
      return {};
    };
  };
};
},{}],"../output/Effect.Ref/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Functor = require("../Data.Functor/index.js");

var Effect = require("../Effect/index.js");

var modify = function modify(f) {
  return $foreign["modify'"](function (s) {
    var s$prime = f(s);
    return {
      state: s$prime,
      value: s$prime
    };
  });
};

var modify_ = function modify_(f) {
  return function (s) {
    return Data_Functor["void"](Effect.functorEffect)(modify(f)(s));
  };
};

module.exports = {
  modify: modify,
  modify_: modify_,
  "new": $foreign["new"],
  read: $foreign.read,
  "modify'": $foreign["modify'"],
  write: $foreign.write
};
},{"./foreign.js":"../output/Effect.Ref/foreign.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Effect/index.js":"../output/Effect/index.js"}],"../output/Control.Monad.Rec.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Effect = require("../Effect/index.js");

var Effect_Ref = require("../Effect.Ref/index.js");

var Loop = function () {
  function Loop(value0) {
    this.value0 = value0;
  }

  ;

  Loop.create = function (value0) {
    return new Loop(value0);
  };

  return Loop;
}();

var Done = function () {
  function Done(value0) {
    this.value0 = value0;
  }

  ;

  Done.create = function (value0) {
    return new Done(value0);
  };

  return Done;
}();

var MonadRec = function MonadRec(Monad0, tailRecM) {
  this.Monad0 = Monad0;
  this.tailRecM = tailRecM;
};

var tailRecM = function tailRecM(dict) {
  return dict.tailRecM;
};

var tailRecM2 = function tailRecM2(dictMonadRec) {
  return function (f) {
    return function (a) {
      return function (b) {
        return tailRecM(dictMonadRec)(function (o) {
          return f(o.a)(o.b);
        })({
          a: a,
          b: b
        });
      };
    };
  };
};

var tailRecM3 = function tailRecM3(dictMonadRec) {
  return function (f) {
    return function (a) {
      return function (b) {
        return function (c) {
          return tailRecM(dictMonadRec)(function (o) {
            return f(o.a)(o.b)(o.c);
          })({
            a: a,
            b: b,
            c: c
          });
        };
      };
    };
  };
};

var untilJust = function untilJust(dictMonadRec) {
  return function (m) {
    return tailRecM(dictMonadRec)(function (v) {
      return Data_Functor.mapFlipped(dictMonadRec.Monad0().Bind1().Apply0().Functor0())(m)(function (v1) {
        if (v1 instanceof Data_Maybe.Nothing) {
          return new Loop(Data_Unit.unit);
        }

        ;

        if (v1 instanceof Data_Maybe.Just) {
          return new Done(v1.value0);
        }

        ;
        throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 155, column 43 - line 157, column 19): " + [v1.constructor.name]);
      });
    })(Data_Unit.unit);
  };
};

var whileJust = function whileJust(dictMonoid) {
  return function (dictMonadRec) {
    return function (m) {
      return tailRecM(dictMonadRec)(function (v) {
        return Data_Functor.mapFlipped(dictMonadRec.Monad0().Bind1().Apply0().Functor0())(m)(function (v1) {
          if (v1 instanceof Data_Maybe.Nothing) {
            return new Done(v);
          }

          ;

          if (v1 instanceof Data_Maybe.Just) {
            return Loop.create(Data_Semigroup.append(dictMonoid.Semigroup0())(v)(v1.value0));
          }

          ;
          throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 148, column 45 - line 150, column 26): " + [v1.constructor.name]);
        });
      })(Data_Monoid.mempty(dictMonoid));
    };
  };
};

var tailRec = function tailRec(f) {
  var go = function go($copy_v) {
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v) {
      if (v instanceof Loop) {
        $copy_v = f(v.value0);
        return;
      }

      ;

      if (v instanceof Done) {
        $tco_done = true;
        return v.value0;
      }

      ;
      throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 93, column 3 - line 93, column 25): " + [v.constructor.name]);
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  return function ($58) {
    return go(f($58));
  };
};

var monadRecMaybe = new MonadRec(function () {
  return Data_Maybe.monadMaybe;
}, function (f) {
  return function (a0) {
    var g = function g(v) {
      if (v instanceof Data_Maybe.Nothing) {
        return new Done(Data_Maybe.Nothing.value);
      }

      ;

      if (v instanceof Data_Maybe.Just && v.value0 instanceof Loop) {
        return new Loop(f(v.value0.value0));
      }

      ;

      if (v instanceof Data_Maybe.Just && v.value0 instanceof Done) {
        return new Done(new Data_Maybe.Just(v.value0.value0));
      }

      ;
      throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 129, column 7 - line 129, column 31): " + [v.constructor.name]);
    };

    return tailRec(g)(f(a0));
  };
});
var monadRecIdentity = new MonadRec(function () {
  return Data_Identity.monadIdentity;
}, function (f) {
  var runIdentity = function runIdentity(v) {
    return v;
  };

  var $59 = tailRec(function ($61) {
    return runIdentity(f($61));
  });
  return function ($60) {
    return Data_Identity.Identity($59($60));
  };
});
var monadRecFunction = new MonadRec(function () {
  return Control_Monad.monadFn;
}, function (f) {
  return function (a0) {
    return function (e) {
      return tailRec(function (a) {
        return f(a)(e);
      })(a0);
    };
  };
});
var monadRecEither = new MonadRec(function () {
  return Data_Either.monadEither;
}, function (f) {
  return function (a0) {
    var g = function g(v) {
      if (v instanceof Data_Either.Left) {
        return new Done(new Data_Either.Left(v.value0));
      }

      ;

      if (v instanceof Data_Either.Right && v.value0 instanceof Loop) {
        return new Loop(f(v.value0.value0));
      }

      ;

      if (v instanceof Data_Either.Right && v.value0 instanceof Done) {
        return new Done(new Data_Either.Right(v.value0.value0));
      }

      ;
      throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 121, column 7 - line 121, column 33): " + [v.constructor.name]);
    };

    return tailRec(g)(f(a0));
  };
});
var monadRecEffect = new MonadRec(function () {
  return Effect.monadEffect;
}, function (f) {
  return function (a) {
    var fromDone = function fromDone(v) {
      if (v instanceof Done) {
        return v.value0;
      }

      ;
      throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 113, column 30 - line 113, column 44): " + [v.constructor.name]);
    };

    return function __do() {
      var r = Control_Bind.bindFlipped(Effect.bindEffect)(Effect_Ref["new"])(f(a))();

      (function () {
        while (!function __do() {
          var v = Effect_Ref.read(r)();

          if (v instanceof Loop) {
            var e = f(v.value0)();
            Effect_Ref.write(e)(r)();
            return false;
          }

          ;

          if (v instanceof Done) {
            return true;
          }

          ;
          throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 104, column 22 - line 109, column 28): " + [v.constructor.name]);
        }()) {}

        ;
        return {};
      })();

      return Data_Functor.map(Effect.functorEffect)(fromDone)(Effect_Ref.read(r))();
    };
  };
});
var functorStep = new Data_Functor.Functor(function (f) {
  return function (m) {
    if (m instanceof Loop) {
      return new Loop(m.value0);
    }

    ;

    if (m instanceof Done) {
      return new Done(f(m.value0));
    }

    ;
    throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 27, column 1 - line 27, column 48): " + [m.constructor.name]);
  };
});

var forever = function forever(dictMonadRec) {
  return function (ma) {
    return tailRecM(dictMonadRec)(function (u) {
      return Data_Functor.voidRight(dictMonadRec.Monad0().Bind1().Apply0().Functor0())(new Loop(u))(ma);
    })(Data_Unit.unit);
  };
};

var bifunctorStep = new Data_Bifunctor.Bifunctor(function (v) {
  return function (v1) {
    return function (v2) {
      if (v2 instanceof Loop) {
        return new Loop(v(v2.value0));
      }

      ;

      if (v2 instanceof Done) {
        return new Done(v1(v2.value0));
      }

      ;
      throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 29, column 1 - line 31, column 34): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
    };
  };
});
module.exports = {
  Loop: Loop,
  Done: Done,
  MonadRec: MonadRec,
  tailRec: tailRec,
  tailRecM: tailRecM,
  tailRecM2: tailRecM2,
  tailRecM3: tailRecM3,
  forever: forever,
  whileJust: whileJust,
  untilJust: untilJust,
  functorStep: functorStep,
  bifunctorStep: bifunctorStep,
  monadRecIdentity: monadRecIdentity,
  monadRecEffect: monadRecEffect,
  monadRecFunction: monadRecFunction,
  monadRecEither: monadRecEither,
  monadRecMaybe: monadRecMaybe
};
},{"../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Effect/index.js":"../output/Effect/index.js","../Effect.Ref/index.js":"../output/Effect.Ref/index.js"}],"../output/Control.Lazy/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Unit = require("../Data.Unit/index.js");

var Lazy = function Lazy(defer) {
  this.defer = defer;
};

var lazyUnit = new Lazy(function (v) {
  return Data_Unit.unit;
});
var lazyFn = new Lazy(function (f) {
  return function (x) {
    return f(Data_Unit.unit)(x);
  };
});

var defer = function defer(dict) {
  return dict.defer;
};

var fix = function fix(dictLazy) {
  return function (f) {
    var go = defer(dictLazy)(function (v) {
      return f(go);
    });
    return go;
  };
};

module.exports = {
  defer: defer,
  Lazy: Lazy,
  fix: fix,
  lazyFn: lazyFn,
  lazyUnit: lazyUnit
};
},{"../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.BooleanAlgebra/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var BooleanAlgebraRecord = function BooleanAlgebraRecord(HeytingAlgebraRecord0) {
  this.HeytingAlgebraRecord0 = HeytingAlgebraRecord0;
};

var BooleanAlgebra = function BooleanAlgebra(HeytingAlgebra0) {
  this.HeytingAlgebra0 = HeytingAlgebra0;
};

var booleanAlgebraUnit = new BooleanAlgebra(function () {
  return Data_HeytingAlgebra.heytingAlgebraUnit;
});
var booleanAlgebraRecordNil = new BooleanAlgebraRecord(function () {
  return Data_HeytingAlgebra.heytingAlgebraRecordNil;
});

var booleanAlgebraRecordCons = function booleanAlgebraRecordCons(dictIsSymbol) {
  return function (dictCons) {
    return function (dictBooleanAlgebraRecord) {
      return function (dictBooleanAlgebra) {
        return new BooleanAlgebraRecord(function () {
          return Data_HeytingAlgebra.heytingAlgebraRecordCons(dictIsSymbol)()(dictBooleanAlgebraRecord.HeytingAlgebraRecord0())(dictBooleanAlgebra.HeytingAlgebra0());
        });
      };
    };
  };
};

var booleanAlgebraRecord = function booleanAlgebraRecord(dictRowToList) {
  return function (dictBooleanAlgebraRecord) {
    return new BooleanAlgebra(function () {
      return Data_HeytingAlgebra.heytingAlgebraRecord()(dictBooleanAlgebraRecord.HeytingAlgebraRecord0());
    });
  };
};

var booleanAlgebraFn = function booleanAlgebraFn(dictBooleanAlgebra) {
  return new BooleanAlgebra(function () {
    return Data_HeytingAlgebra.heytingAlgebraFunction(dictBooleanAlgebra.HeytingAlgebra0());
  });
};

var booleanAlgebraBoolean = new BooleanAlgebra(function () {
  return Data_HeytingAlgebra.heytingAlgebraBoolean;
});
module.exports = {
  BooleanAlgebra: BooleanAlgebra,
  BooleanAlgebraRecord: BooleanAlgebraRecord,
  booleanAlgebraBoolean: booleanAlgebraBoolean,
  booleanAlgebraUnit: booleanAlgebraUnit,
  booleanAlgebraFn: booleanAlgebraFn,
  booleanAlgebraRecord: booleanAlgebraRecord,
  booleanAlgebraRecordNil: booleanAlgebraRecordNil,
  booleanAlgebraRecordCons: booleanAlgebraRecordCons
};
},{"../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js"}],"../output/Data.Distributive/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Distributive = function Distributive(Functor0, collect, distribute) {
  this.Functor0 = Functor0;
  this.collect = collect;
  this.distribute = distribute;
};

var distributiveIdentity = new Distributive(function () {
  return Data_Identity.functorIdentity;
}, function (dictFunctor) {
  return function (f) {
    var $11 = Data_Functor.map(dictFunctor)(function () {
      var $13 = Data_Newtype.unwrap(Data_Identity.newtypeIdentity);
      return function ($14) {
        return $13(f($14));
      };
    }());
    return function ($12) {
      return Data_Identity.Identity($11($12));
    };
  };
}, function (dictFunctor) {
  var $15 = Data_Functor.map(dictFunctor)(Data_Newtype.unwrap(Data_Identity.newtypeIdentity));
  return function ($16) {
    return Data_Identity.Identity($15($16));
  };
});

var distribute = function distribute(dict) {
  return dict.distribute;
};

var distributiveFunction = new Distributive(function () {
  return Data_Functor.functorFn;
}, function (dictFunctor) {
  return function (f) {
    var $17 = distribute(distributiveFunction)(dictFunctor);
    var $18 = Data_Functor.map(dictFunctor)(f);
    return function ($19) {
      return $17($18($19));
    };
  };
}, function (dictFunctor) {
  return function (a) {
    return function (e) {
      return Data_Functor.map(dictFunctor)(function (v) {
        return v(e);
      })(a);
    };
  };
});

var cotraverse = function cotraverse(dictDistributive) {
  return function (dictFunctor) {
    return function (f) {
      var $20 = Data_Functor.map(dictDistributive.Functor0())(f);
      var $21 = distribute(dictDistributive)(dictFunctor);
      return function ($22) {
        return $20($21($22));
      };
    };
  };
};

var collectDefault = function collectDefault(dictDistributive) {
  return function (dictFunctor) {
    return function (f) {
      var $23 = distribute(dictDistributive)(dictFunctor);
      var $24 = Data_Functor.map(dictFunctor)(f);
      return function ($25) {
        return $23($24($25));
      };
    };
  };
};

var collect = function collect(dict) {
  return dict.collect;
};

var distributeDefault = function distributeDefault(dictDistributive) {
  return function (dictFunctor) {
    return collect(dictDistributive)(dictFunctor)(Control_Category.identity(Control_Category.categoryFn));
  };
};

module.exports = {
  collect: collect,
  distribute: distribute,
  Distributive: Distributive,
  distributeDefault: distributeDefault,
  collectDefault: collectDefault,
  cotraverse: cotraverse,
  distributiveIdentity: distributiveIdentity,
  distributiveFunction: distributiveFunction
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js"}],"../output/Type.Equality/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var TypeEquals = function TypeEquals(from, to) {
  this.from = from;
  this.to = to;
};

var to = function to(dict) {
  return dict.to;
};

var refl = new TypeEquals(function (a) {
  return a;
}, function (a) {
  return a;
});

var from = function from(dict) {
  return dict.from;
};

module.exports = {
  TypeEquals: TypeEquals,
  to: to,
  from: from,
  refl: refl
};
},{}],"../output/Data.Tuple/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Biapplicative = require("../Control.Biapplicative/index.js");

var Control_Biapply = require("../Control.Biapply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Comonad = require("../Control.Comonad/index.js");

var Control_Extend = require("../Control.Extend/index.js");

var Control_Lazy = require("../Control.Lazy/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Bifoldable = require("../Data.Bifoldable/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Bitraversable = require("../Data.Bitraversable/index.js");

var Data_BooleanAlgebra = require("../Data.BooleanAlgebra/index.js");

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_CommutativeRing = require("../Data.CommutativeRing/index.js");

var Data_Distributive = require("../Data.Distributive/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Invariant = require("../Data.Functor.Invariant/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Maybe_First = require("../Data.Maybe.First/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Ring = require("../Data.Ring/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semigroup_Foldable = require("../Data.Semigroup.Foldable/index.js");

var Data_Semigroup_Traversable = require("../Data.Semigroup.Traversable/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Type_Equality = require("../Type.Equality/index.js");

var Tuple = function () {
  function Tuple(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Tuple.create = function (value0) {
    return function (value1) {
      return new Tuple(value0, value1);
    };
  };

  return Tuple;
}();

var uncurry = function uncurry(f) {
  return function (v) {
    return f(v.value0)(v.value1);
  };
};

var swap = function swap(v) {
  return new Tuple(v.value1, v.value0);
};

var snd = function snd(v) {
  return v.value1;
};

var showTuple = function showTuple(dictShow) {
  return function (dictShow1) {
    return new Data_Show.Show(function (v) {
      return "(Tuple " + (Data_Show.show(dictShow)(v.value0) + (" " + (Data_Show.show(dictShow1)(v.value1) + ")")));
    });
  };
};

var semiringTuple = function semiringTuple(dictSemiring) {
  return function (dictSemiring1) {
    return new Data_Semiring.Semiring(function (v) {
      return function (v1) {
        return new Tuple(Data_Semiring.add(dictSemiring)(v.value0)(v1.value0), Data_Semiring.add(dictSemiring1)(v.value1)(v1.value1));
      };
    }, function (v) {
      return function (v1) {
        return new Tuple(Data_Semiring.mul(dictSemiring)(v.value0)(v1.value0), Data_Semiring.mul(dictSemiring1)(v.value1)(v1.value1));
      };
    }, new Tuple(Data_Semiring.one(dictSemiring), Data_Semiring.one(dictSemiring1)), new Tuple(Data_Semiring.zero(dictSemiring), Data_Semiring.zero(dictSemiring1)));
  };
};

var semigroupoidTuple = new Control_Semigroupoid.Semigroupoid(function (v) {
  return function (v1) {
    return new Tuple(v1.value0, v.value1);
  };
});

var semigroupTuple = function semigroupTuple(dictSemigroup) {
  return function (dictSemigroup1) {
    return new Data_Semigroup.Semigroup(function (v) {
      return function (v1) {
        return new Tuple(Data_Semigroup.append(dictSemigroup)(v.value0)(v1.value0), Data_Semigroup.append(dictSemigroup1)(v.value1)(v1.value1));
      };
    });
  };
};

var ringTuple = function ringTuple(dictRing) {
  return function (dictRing1) {
    return new Data_Ring.Ring(function () {
      return semiringTuple(dictRing.Semiring0())(dictRing1.Semiring0());
    }, function (v) {
      return function (v1) {
        return new Tuple(Data_Ring.sub(dictRing)(v.value0)(v1.value0), Data_Ring.sub(dictRing1)(v.value1)(v1.value1));
      };
    });
  };
};

var monoidTuple = function monoidTuple(dictMonoid) {
  return function (dictMonoid1) {
    return new Data_Monoid.Monoid(function () {
      return semigroupTuple(dictMonoid.Semigroup0())(dictMonoid1.Semigroup0());
    }, new Tuple(Data_Monoid.mempty(dictMonoid), Data_Monoid.mempty(dictMonoid1)));
  };
};

var lookup = function lookup(dictFoldable) {
  return function (dictEq) {
    return function (a) {
      var $312 = Data_Newtype.unwrap(Data_Maybe_First.newtypeFirst);
      var $313 = Data_Foldable.foldMap(dictFoldable)(Data_Maybe_First.monoidFirst)(function (v) {
        var $163 = Data_Eq.eq(dictEq)(a)(v.value0);

        if ($163) {
          return new Data_Maybe.Just(v.value1);
        }

        ;
        return Data_Maybe.Nothing.value;
      });
      return function ($314) {
        return $312($313($314));
      };
    };
  };
};

var heytingAlgebraTuple = function heytingAlgebraTuple(dictHeytingAlgebra) {
  return function (dictHeytingAlgebra1) {
    return new Data_HeytingAlgebra.HeytingAlgebra(function (v) {
      return function (v1) {
        return new Tuple(Data_HeytingAlgebra.conj(dictHeytingAlgebra)(v.value0)(v1.value0), Data_HeytingAlgebra.conj(dictHeytingAlgebra1)(v.value1)(v1.value1));
      };
    }, function (v) {
      return function (v1) {
        return new Tuple(Data_HeytingAlgebra.disj(dictHeytingAlgebra)(v.value0)(v1.value0), Data_HeytingAlgebra.disj(dictHeytingAlgebra1)(v.value1)(v1.value1));
      };
    }, new Tuple(Data_HeytingAlgebra.ff(dictHeytingAlgebra), Data_HeytingAlgebra.ff(dictHeytingAlgebra1)), function (v) {
      return function (v1) {
        return new Tuple(Data_HeytingAlgebra.implies(dictHeytingAlgebra)(v.value0)(v1.value0), Data_HeytingAlgebra.implies(dictHeytingAlgebra1)(v.value1)(v1.value1));
      };
    }, function (v) {
      return new Tuple(Data_HeytingAlgebra.not(dictHeytingAlgebra)(v.value0), Data_HeytingAlgebra.not(dictHeytingAlgebra1)(v.value1));
    }, new Tuple(Data_HeytingAlgebra.tt(dictHeytingAlgebra), Data_HeytingAlgebra.tt(dictHeytingAlgebra1)));
  };
};

var functorTuple = new Data_Functor.Functor(function (f) {
  return function (m) {
    return new Tuple(m.value0, f(m.value1));
  };
});
var functorWithIndexTuple = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorTuple;
}, function (f) {
  return Data_Functor.map(functorTuple)(f(Data_Unit.unit));
});
var invariantTuple = new Data_Functor_Invariant.Invariant(Data_Functor_Invariant.imapF(functorTuple));

var fst = function fst(v) {
  return v.value0;
};

var lazyTuple = function lazyTuple(dictLazy) {
  return function (dictLazy1) {
    return new Control_Lazy.Lazy(function (f) {
      return new Tuple(Control_Lazy.defer(dictLazy)(function (v) {
        return fst(f(Data_Unit.unit));
      }), Control_Lazy.defer(dictLazy1)(function (v) {
        return snd(f(Data_Unit.unit));
      }));
    });
  };
};

var foldableTuple = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v.value1);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(z)(v.value1);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(v.value1)(z);
    };
  };
});
var foldableWithIndexTuple = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableTuple;
}, function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(Data_Unit.unit)(v.value1);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(Data_Unit.unit)(z)(v.value1);
    };
  };
}, function (f) {
  return function (z) {
    return function (v) {
      return f(Data_Unit.unit)(v.value1)(z);
    };
  };
});
var traversableTuple = new Data_Traversable.Traversable(function () {
  return foldableTuple;
}, function () {
  return functorTuple;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Tuple.create(v.value0))(v.value1);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Tuple.create(v.value0))(f(v.value1));
    };
  };
});
var traversableWithIndexTuple = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexTuple;
}, function () {
  return functorWithIndexTuple;
}, function () {
  return traversableTuple;
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Tuple.create(v.value0))(f(Data_Unit.unit)(v.value1));
    };
  };
});
var foldable1Tuple = new Data_Semigroup_Foldable.Foldable1(function () {
  return foldableTuple;
}, function (dictSemigroup) {
  return function (v) {
    return v.value1;
  };
}, function (dictSemigroup) {
  return function (f) {
    return function (v) {
      return f(v.value1);
    };
  };
});
var traversable1Tuple = new Data_Semigroup_Traversable.Traversable1(function () {
  return foldable1Tuple;
}, function () {
  return traversableTuple;
}, function (dictApply) {
  return function (v) {
    return Data_Functor.map(dictApply.Functor0())(Tuple.create(v.value0))(v.value1);
  };
}, function (dictApply) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApply.Functor0())(Tuple.create(v.value0))(f(v.value1));
    };
  };
});
var extendTuple = new Control_Extend.Extend(function () {
  return functorTuple;
}, function (f) {
  return function (v) {
    return new Tuple(v.value0, f(v));
  };
});

var eqTuple = function eqTuple(dictEq) {
  return function (dictEq1) {
    return new Data_Eq.Eq(function (x) {
      return function (y) {
        return Data_Eq.eq(dictEq)(x.value0)(y.value0) && Data_Eq.eq(dictEq1)(x.value1)(y.value1);
      };
    });
  };
};

var ordTuple = function ordTuple(dictOrd) {
  return function (dictOrd1) {
    return new Data_Ord.Ord(function () {
      return eqTuple(dictOrd.Eq0())(dictOrd1.Eq0());
    }, function (x) {
      return function (y) {
        var v = Data_Ord.compare(dictOrd)(x.value0)(y.value0);

        if (v instanceof Data_Ordering.LT) {
          return Data_Ordering.LT.value;
        }

        ;

        if (v instanceof Data_Ordering.GT) {
          return Data_Ordering.GT.value;
        }

        ;
        return Data_Ord.compare(dictOrd1)(x.value1)(y.value1);
      };
    });
  };
};

var eq1Tuple = function eq1Tuple(dictEq) {
  return new Data_Eq.Eq1(function (dictEq1) {
    return Data_Eq.eq(eqTuple(dictEq)(dictEq1));
  });
};

var ord1Tuple = function ord1Tuple(dictOrd) {
  return new Data_Ord.Ord1(function () {
    return eq1Tuple(dictOrd.Eq0());
  }, function (dictOrd1) {
    return Data_Ord.compare(ordTuple(dictOrd)(dictOrd1));
  });
};

var distributiveTuple = function distributiveTuple(dictTypeEquals) {
  return new Data_Distributive.Distributive(function () {
    return functorTuple;
  }, function (dictFunctor) {
    return Data_Distributive.collectDefault(distributiveTuple(dictTypeEquals))(dictFunctor);
  }, function (dictFunctor) {
    var $315 = Tuple.create(Type_Equality.from(dictTypeEquals)(Data_Unit.unit));
    var $316 = Data_Functor.map(dictFunctor)(snd);
    return function ($317) {
      return $315($316($317));
    };
  });
};

var curry = function curry(f) {
  return function (a) {
    return function (b) {
      return f(new Tuple(a, b));
    };
  };
};

var comonadTuple = new Control_Comonad.Comonad(function () {
  return extendTuple;
}, snd);

var commutativeRingTuple = function commutativeRingTuple(dictCommutativeRing) {
  return function (dictCommutativeRing1) {
    return new Data_CommutativeRing.CommutativeRing(function () {
      return ringTuple(dictCommutativeRing.Ring0())(dictCommutativeRing1.Ring0());
    });
  };
};

var boundedTuple = function boundedTuple(dictBounded) {
  return function (dictBounded1) {
    return new Data_Bounded.Bounded(function () {
      return ordTuple(dictBounded.Ord0())(dictBounded1.Ord0());
    }, new Tuple(Data_Bounded.bottom(dictBounded), Data_Bounded.bottom(dictBounded1)), new Tuple(Data_Bounded.top(dictBounded), Data_Bounded.top(dictBounded1)));
  };
};

var booleanAlgebraTuple = function booleanAlgebraTuple(dictBooleanAlgebra) {
  return function (dictBooleanAlgebra1) {
    return new Data_BooleanAlgebra.BooleanAlgebra(function () {
      return heytingAlgebraTuple(dictBooleanAlgebra.HeytingAlgebra0())(dictBooleanAlgebra1.HeytingAlgebra0());
    });
  };
};

var bifunctorTuple = new Data_Bifunctor.Bifunctor(function (f) {
  return function (g) {
    return function (v) {
      return new Tuple(f(v.value0), g(v.value1));
    };
  };
});
var bifoldableTuple = new Data_Bifoldable.Bifoldable(function (dictMonoid) {
  return function (f) {
    return function (g) {
      return function (v) {
        return Data_Semigroup.append(dictMonoid.Semigroup0())(f(v.value0))(g(v.value1));
      };
    };
  };
}, function (f) {
  return function (g) {
    return function (z) {
      return function (v) {
        return g(f(z)(v.value0))(v.value1);
      };
    };
  };
}, function (f) {
  return function (g) {
    return function (z) {
      return function (v) {
        return f(v.value0)(g(v.value1)(z));
      };
    };
  };
});
var bitraversableTuple = new Data_Bitraversable.Bitraversable(function () {
  return bifoldableTuple;
}, function () {
  return bifunctorTuple;
}, function (dictApplicative) {
  return function (v) {
    return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Tuple.create)(v.value0))(v.value1);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (g) {
      return function (v) {
        return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Tuple.create)(f(v.value0)))(g(v.value1));
      };
    };
  };
});
var biapplyTuple = new Control_Biapply.Biapply(function () {
  return bifunctorTuple;
}, function (v) {
  return function (v1) {
    return new Tuple(v.value0(v1.value0), v.value1(v1.value1));
  };
});
var biapplicativeTuple = new Control_Biapplicative.Biapplicative(function () {
  return biapplyTuple;
}, Tuple.create);

var applyTuple = function applyTuple(dictSemigroup) {
  return new Control_Apply.Apply(function () {
    return functorTuple;
  }, function (v) {
    return function (v1) {
      return new Tuple(Data_Semigroup.append(dictSemigroup)(v.value0)(v1.value0), v.value1(v1.value1));
    };
  });
};

var bindTuple = function bindTuple(dictSemigroup) {
  return new Control_Bind.Bind(function () {
    return applyTuple(dictSemigroup);
  }, function (v) {
    return function (f) {
      var v1 = f(v.value1);
      return new Tuple(Data_Semigroup.append(dictSemigroup)(v.value0)(v1.value0), v1.value1);
    };
  });
};

var applicativeTuple = function applicativeTuple(dictMonoid) {
  return new Control_Applicative.Applicative(function () {
    return applyTuple(dictMonoid.Semigroup0());
  }, Tuple.create(Data_Monoid.mempty(dictMonoid)));
};

var monadTuple = function monadTuple(dictMonoid) {
  return new Control_Monad.Monad(function () {
    return applicativeTuple(dictMonoid);
  }, function () {
    return bindTuple(dictMonoid.Semigroup0());
  });
};

module.exports = {
  Tuple: Tuple,
  fst: fst,
  snd: snd,
  curry: curry,
  uncurry: uncurry,
  swap: swap,
  lookup: lookup,
  showTuple: showTuple,
  eqTuple: eqTuple,
  eq1Tuple: eq1Tuple,
  ordTuple: ordTuple,
  ord1Tuple: ord1Tuple,
  boundedTuple: boundedTuple,
  semigroupoidTuple: semigroupoidTuple,
  semigroupTuple: semigroupTuple,
  monoidTuple: monoidTuple,
  semiringTuple: semiringTuple,
  ringTuple: ringTuple,
  commutativeRingTuple: commutativeRingTuple,
  heytingAlgebraTuple: heytingAlgebraTuple,
  booleanAlgebraTuple: booleanAlgebraTuple,
  functorTuple: functorTuple,
  functorWithIndexTuple: functorWithIndexTuple,
  invariantTuple: invariantTuple,
  bifunctorTuple: bifunctorTuple,
  applyTuple: applyTuple,
  biapplyTuple: biapplyTuple,
  applicativeTuple: applicativeTuple,
  biapplicativeTuple: biapplicativeTuple,
  bindTuple: bindTuple,
  monadTuple: monadTuple,
  extendTuple: extendTuple,
  comonadTuple: comonadTuple,
  lazyTuple: lazyTuple,
  foldableTuple: foldableTuple,
  foldable1Tuple: foldable1Tuple,
  foldableWithIndexTuple: foldableWithIndexTuple,
  bifoldableTuple: bifoldableTuple,
  traversableTuple: traversableTuple,
  traversable1Tuple: traversable1Tuple,
  traversableWithIndexTuple: traversableWithIndexTuple,
  bitraversableTuple: bitraversableTuple,
  distributiveTuple: distributiveTuple
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Biapplicative/index.js":"../output/Control.Biapplicative/index.js","../Control.Biapply/index.js":"../output/Control.Biapply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Comonad/index.js":"../output/Control.Comonad/index.js","../Control.Extend/index.js":"../output/Control.Extend/index.js","../Control.Lazy/index.js":"../output/Control.Lazy/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Bifoldable/index.js":"../output/Data.Bifoldable/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Bitraversable/index.js":"../output/Data.Bitraversable/index.js","../Data.BooleanAlgebra/index.js":"../output/Data.BooleanAlgebra/index.js","../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.CommutativeRing/index.js":"../output/Data.CommutativeRing/index.js","../Data.Distributive/index.js":"../output/Data.Distributive/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Invariant/index.js":"../output/Data.Functor.Invariant/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Maybe.First/index.js":"../output/Data.Maybe.First/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Ring/index.js":"../output/Data.Ring/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semigroup.Foldable/index.js":"../output/Data.Semigroup.Foldable/index.js","../Data.Semigroup.Traversable/index.js":"../output/Data.Semigroup.Traversable/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Type.Equality/index.js":"../output/Type.Equality/index.js"}],"../output/Control.Monad.State.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var MonadState = function MonadState(Monad0, state) {
  this.Monad0 = Monad0;
  this.state = state;
};

var state = function state(dict) {
  return dict.state;
};

var put = function put(dictMonadState) {
  return function (s) {
    return state(dictMonadState)(function (v) {
      return new Data_Tuple.Tuple(Data_Unit.unit, s);
    });
  };
};

var modify_ = function modify_(dictMonadState) {
  return function (f) {
    return state(dictMonadState)(function (s) {
      return new Data_Tuple.Tuple(Data_Unit.unit, f(s));
    });
  };
};

var modify = function modify(dictMonadState) {
  return function (f) {
    return state(dictMonadState)(function (s) {
      var s$prime = f(s);
      return new Data_Tuple.Tuple(s$prime, s$prime);
    });
  };
};

var gets = function gets(dictMonadState) {
  return function (f) {
    return state(dictMonadState)(function (s) {
      return new Data_Tuple.Tuple(f(s), s);
    });
  };
};

var get = function get(dictMonadState) {
  return state(dictMonadState)(function (s) {
    return new Data_Tuple.Tuple(s, s);
  });
};

module.exports = {
  state: state,
  MonadState: MonadState,
  get: get,
  gets: gets,
  put: put,
  modify: modify,
  modify_: modify_
};
},{"../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Control.Monad.Trans.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var MonadTrans = function MonadTrans(lift) {
  this.lift = lift;
};

var lift = function lift(dict) {
  return dict.lift;
};

module.exports = {
  lift: lift,
  MonadTrans: MonadTrans
};
},{}],"../output/Control.Monad.Writer.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var MonadTell = function MonadTell(Monad0, tell) {
  this.Monad0 = Monad0;
  this.tell = tell;
};

var MonadWriter = function MonadWriter(MonadTell0, listen, pass) {
  this.MonadTell0 = MonadTell0;
  this.listen = listen;
  this.pass = pass;
};

var tell = function tell(dict) {
  return dict.tell;
};

var pass = function pass(dict) {
  return dict.pass;
};

var listen = function listen(dict) {
  return dict.listen;
};

var listens = function listens(dictMonadWriter) {
  return function (f) {
    return function (m) {
      return Control_Bind.bind(dictMonadWriter.MonadTell0().Monad0().Bind1())(listen(dictMonadWriter)(m))(function (v) {
        return Control_Applicative.pure(dictMonadWriter.MonadTell0().Monad0().Applicative0())(new Data_Tuple.Tuple(v.value0, f(v.value1)));
      });
    };
  };
};

var censor = function censor(dictMonadWriter) {
  return function (f) {
    return function (m) {
      return pass(dictMonadWriter)(Control_Bind.bind(dictMonadWriter.MonadTell0().Monad0().Bind1())(m)(function (a) {
        return Control_Applicative.pure(dictMonadWriter.MonadTell0().Monad0().Applicative0())(new Data_Tuple.Tuple(a, f));
      }));
    };
  };
};

module.exports = {
  listen: listen,
  pass: pass,
  tell: tell,
  MonadTell: MonadTell,
  MonadWriter: MonadWriter,
  listens: listens,
  censor: censor
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Control.MonadPlus/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_MonadZero = require("../Control.MonadZero/index.js");

var MonadPlus = function MonadPlus(MonadZero0) {
  this.MonadZero0 = MonadZero0;
};

var monadPlusArray = new MonadPlus(function () {
  return Control_MonadZero.monadZeroArray;
});
module.exports = {
  MonadPlus: MonadPlus,
  monadPlusArray: monadPlusArray
};
},{"../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js"}],"../output/Effect.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Effect = require("../Effect/index.js");

var MonadEffect = function MonadEffect(Monad0, liftEffect) {
  this.Monad0 = Monad0;
  this.liftEffect = liftEffect;
};

var monadEffectEffect = new MonadEffect(function () {
  return Effect.monadEffect;
}, Control_Category.identity(Control_Category.categoryFn));

var liftEffect = function liftEffect(dict) {
  return dict.liftEffect;
};

module.exports = {
  liftEffect: liftEffect,
  MonadEffect: MonadEffect,
  monadEffectEffect: monadEffectEffect
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Effect/index.js":"../output/Effect/index.js"}],"../output/Control.Monad.Except.Trans/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Monad_Cont_Class = require("../Control.Monad.Cont.Class/index.js");

var Control_Monad_Error_Class = require("../Control.Monad.Error.Class/index.js");

var Control_Monad_Reader_Class = require("../Control.Monad.Reader.Class/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Control_Monad_State_Class = require("../Control.Monad.State.Class/index.js");

var Control_Monad_Trans_Class = require("../Control.Monad.Trans.Class/index.js");

var Control_Monad_Writer_Class = require("../Control.Monad.Writer.Class/index.js");

var Control_MonadPlus = require("../Control.MonadPlus/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var ExceptT = function ExceptT(x) {
  return x;
};

var withExceptT = function withExceptT(dictFunctor) {
  return function (f) {
    return function (v) {
      var mapLeft = function mapLeft(v1) {
        return function (v2) {
          if (v2 instanceof Data_Either.Right) {
            return new Data_Either.Right(v2.value0);
          }

          ;

          if (v2 instanceof Data_Either.Left) {
            return new Data_Either.Left(v1(v2.value0));
          }

          ;
          throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 42, column 3 - line 42, column 32): " + [v1.constructor.name, v2.constructor.name]);
        };
      };

      return ExceptT(Data_Functor.map(dictFunctor)(mapLeft(f))(v));
    };
  };
};

var runExceptT = function runExceptT(v) {
  return v;
};

var newtypeExceptT = new Data_Newtype.Newtype(function (n) {
  return n;
}, ExceptT);
var monadTransExceptT = new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) {
  return function (m) {
    return Control_Bind.bind(dictMonad.Bind1())(m)(function (a) {
      return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Either.Right(a));
    });
  };
});

var mapExceptT = function mapExceptT(f) {
  return function (v) {
    return f(v);
  };
};

var functorExceptT = function functorExceptT(dictFunctor) {
  return new Data_Functor.Functor(function (f) {
    return mapExceptT(Data_Functor.map(dictFunctor)(Data_Functor.map(Data_Either.functorEither)(f)));
  });
};

var except = function except(dictApplicative) {
  var $88 = Control_Applicative.pure(dictApplicative);
  return function ($89) {
    return ExceptT($88($89));
  };
};

var monadExceptT = function monadExceptT(dictMonad) {
  return new Control_Monad.Monad(function () {
    return applicativeExceptT(dictMonad);
  }, function () {
    return bindExceptT(dictMonad);
  });
};

var bindExceptT = function bindExceptT(dictMonad) {
  return new Control_Bind.Bind(function () {
    return applyExceptT(dictMonad);
  }, function (v) {
    return function (k) {
      return Control_Bind.bind(dictMonad.Bind1())(v)(Data_Either.either(function () {
        var $90 = Control_Applicative.pure(dictMonad.Applicative0());
        return function ($91) {
          return $90(Data_Either.Left.create($91));
        };
      }())(function (a) {
        var v1 = k(a);
        return v1;
      }));
    };
  });
};

var applyExceptT = function applyExceptT(dictMonad) {
  return new Control_Apply.Apply(function () {
    return functorExceptT(dictMonad.Bind1().Apply0().Functor0());
  }, Control_Monad.ap(monadExceptT(dictMonad)));
};

var applicativeExceptT = function applicativeExceptT(dictMonad) {
  return new Control_Applicative.Applicative(function () {
    return applyExceptT(dictMonad);
  }, function () {
    var $92 = Control_Applicative.pure(dictMonad.Applicative0());
    return function ($93) {
      return ExceptT($92(Data_Either.Right.create($93)));
    };
  }());
};

var monadAskExceptT = function monadAskExceptT(dictMonadAsk) {
  return new Control_Monad_Reader_Class.MonadAsk(function () {
    return monadExceptT(dictMonadAsk.Monad0());
  }, Control_Monad_Trans_Class.lift(monadTransExceptT)(dictMonadAsk.Monad0())(Control_Monad_Reader_Class.ask(dictMonadAsk)));
};

var monadReaderExceptT = function monadReaderExceptT(dictMonadReader) {
  return new Control_Monad_Reader_Class.MonadReader(function () {
    return monadAskExceptT(dictMonadReader.MonadAsk0());
  }, function (f) {
    return mapExceptT(Control_Monad_Reader_Class.local(dictMonadReader)(f));
  });
};

var monadContExceptT = function monadContExceptT(dictMonadCont) {
  return new Control_Monad_Cont_Class.MonadCont(function () {
    return monadExceptT(dictMonadCont.Monad0());
  }, function (f) {
    return ExceptT(Control_Monad_Cont_Class.callCC(dictMonadCont)(function (c) {
      var v = f(function (a) {
        return ExceptT(c(new Data_Either.Right(a)));
      });
      return v;
    }));
  });
};

var monadEffectExceptT = function monadEffectExceptT(dictMonadEffect) {
  return new Effect_Class.MonadEffect(function () {
    return monadExceptT(dictMonadEffect.Monad0());
  }, function () {
    var $94 = Control_Monad_Trans_Class.lift(monadTransExceptT)(dictMonadEffect.Monad0());
    var $95 = Effect_Class.liftEffect(dictMonadEffect);
    return function ($96) {
      return $94($95($96));
    };
  }());
};

var monadRecExceptT = function monadRecExceptT(dictMonadRec) {
  return new Control_Monad_Rec_Class.MonadRec(function () {
    return monadExceptT(dictMonadRec.Monad0());
  }, function (f) {
    var $97 = Control_Monad_Rec_Class.tailRecM(dictMonadRec)(function (a) {
      var v = f(a);
      return Control_Bind.bind(dictMonadRec.Monad0().Bind1())(v)(function (m$prime) {
        return Control_Applicative.pure(dictMonadRec.Monad0().Applicative0())(function () {
          if (m$prime instanceof Data_Either.Left) {
            return new Control_Monad_Rec_Class.Done(new Data_Either.Left(m$prime.value0));
          }

          ;

          if (m$prime instanceof Data_Either.Right && m$prime.value0 instanceof Control_Monad_Rec_Class.Loop) {
            return new Control_Monad_Rec_Class.Loop(m$prime.value0.value0);
          }

          ;

          if (m$prime instanceof Data_Either.Right && m$prime.value0 instanceof Control_Monad_Rec_Class.Done) {
            return new Control_Monad_Rec_Class.Done(new Data_Either.Right(m$prime.value0.value0));
          }

          ;
          throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 74, column 14 - line 77, column 43): " + [m$prime.constructor.name]);
        }());
      });
    });
    return function ($98) {
      return ExceptT($97($98));
    };
  });
};

var monadStateExceptT = function monadStateExceptT(dictMonadState) {
  return new Control_Monad_State_Class.MonadState(function () {
    return monadExceptT(dictMonadState.Monad0());
  }, function (f) {
    return Control_Monad_Trans_Class.lift(monadTransExceptT)(dictMonadState.Monad0())(Control_Monad_State_Class.state(dictMonadState)(f));
  });
};

var monadTellExceptT = function monadTellExceptT(dictMonadTell) {
  return new Control_Monad_Writer_Class.MonadTell(function () {
    return monadExceptT(dictMonadTell.Monad0());
  }, function () {
    var $99 = Control_Monad_Trans_Class.lift(monadTransExceptT)(dictMonadTell.Monad0());
    var $100 = Control_Monad_Writer_Class.tell(dictMonadTell);
    return function ($101) {
      return $99($100($101));
    };
  }());
};

var monadWriterExceptT = function monadWriterExceptT(dictMonadWriter) {
  return new Control_Monad_Writer_Class.MonadWriter(function () {
    return monadTellExceptT(dictMonadWriter.MonadTell0());
  }, mapExceptT(function (m) {
    return Control_Bind.bind(dictMonadWriter.MonadTell0().Monad0().Bind1())(Control_Monad_Writer_Class.listen(dictMonadWriter)(m))(function (v) {
      return Control_Applicative.pure(dictMonadWriter.MonadTell0().Monad0().Applicative0())(Data_Functor.map(Data_Either.functorEither)(function (r) {
        return new Data_Tuple.Tuple(r, v.value1);
      })(v.value0));
    });
  }), mapExceptT(function (m) {
    return Control_Monad_Writer_Class.pass(dictMonadWriter)(Control_Bind.bind(dictMonadWriter.MonadTell0().Monad0().Bind1())(m)(function (a) {
      return Control_Applicative.pure(dictMonadWriter.MonadTell0().Monad0().Applicative0())(function () {
        if (a instanceof Data_Either.Left) {
          return new Data_Tuple.Tuple(new Data_Either.Left(a.value0), Control_Category.identity(Control_Category.categoryFn));
        }

        ;

        if (a instanceof Data_Either.Right) {
          return new Data_Tuple.Tuple(new Data_Either.Right(a.value0.value0), a.value0.value1);
        }

        ;
        throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 136, column 10 - line 138, column 45): " + [a.constructor.name]);
      }());
    }));
  }));
};

var monadThrowExceptT = function monadThrowExceptT(dictMonad) {
  return new Control_Monad_Error_Class.MonadThrow(function () {
    return monadExceptT(dictMonad);
  }, function () {
    var $102 = Control_Applicative.pure(dictMonad.Applicative0());
    return function ($103) {
      return ExceptT($102(Data_Either.Left.create($103)));
    };
  }());
};

var monadErrorExceptT = function monadErrorExceptT(dictMonad) {
  return new Control_Monad_Error_Class.MonadError(function () {
    return monadThrowExceptT(dictMonad);
  }, function (v) {
    return function (k) {
      return Control_Bind.bind(dictMonad.Bind1())(v)(Data_Either.either(function (a) {
        var v1 = k(a);
        return v1;
      })(function () {
        var $104 = Control_Applicative.pure(dictMonad.Applicative0());
        return function ($105) {
          return $104(Data_Either.Right.create($105));
        };
      }()));
    };
  });
};

var altExceptT = function altExceptT(dictSemigroup) {
  return function (dictMonad) {
    return new Control_Alt.Alt(function () {
      return functorExceptT(dictMonad.Bind1().Apply0().Functor0());
    }, function (v) {
      return function (v1) {
        return Control_Bind.bind(dictMonad.Bind1())(v)(function (rm) {
          if (rm instanceof Data_Either.Right) {
            return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Either.Right(rm.value0));
          }

          ;

          if (rm instanceof Data_Either.Left) {
            return Control_Bind.bind(dictMonad.Bind1())(v1)(function (rn) {
              if (rn instanceof Data_Either.Right) {
                return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Either.Right(rn.value0));
              }

              ;

              if (rn instanceof Data_Either.Left) {
                return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Either.Left(Data_Semigroup.append(dictSemigroup)(rm.value0)(rn.value0)));
              }

              ;
              throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 86, column 9 - line 88, column 49): " + [rn.constructor.name]);
            });
          }

          ;
          throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 82, column 5 - line 88, column 49): " + [rm.constructor.name]);
        });
      };
    });
  };
};

var plusExceptT = function plusExceptT(dictMonoid) {
  return function (dictMonad) {
    return new Control_Plus.Plus(function () {
      return altExceptT(dictMonoid.Semigroup0())(dictMonad);
    }, Control_Monad_Error_Class.throwError(monadThrowExceptT(dictMonad))(Data_Monoid.mempty(dictMonoid)));
  };
};

var alternativeExceptT = function alternativeExceptT(dictMonoid) {
  return function (dictMonad) {
    return new Control_Alternative.Alternative(function () {
      return applicativeExceptT(dictMonad);
    }, function () {
      return plusExceptT(dictMonoid)(dictMonad);
    });
  };
};

var monadZeroExceptT = function monadZeroExceptT(dictMonoid) {
  return function (dictMonad) {
    return new Control_MonadZero.MonadZero(function () {
      return alternativeExceptT(dictMonoid)(dictMonad);
    }, function () {
      return monadExceptT(dictMonad);
    });
  };
};

var monadPlusExceptT = function monadPlusExceptT(dictMonoid) {
  return function (dictMonad) {
    return new Control_MonadPlus.MonadPlus(function () {
      return monadZeroExceptT(dictMonoid)(dictMonad);
    });
  };
};

module.exports = {
  ExceptT: ExceptT,
  runExceptT: runExceptT,
  withExceptT: withExceptT,
  mapExceptT: mapExceptT,
  except: except,
  newtypeExceptT: newtypeExceptT,
  functorExceptT: functorExceptT,
  applyExceptT: applyExceptT,
  applicativeExceptT: applicativeExceptT,
  bindExceptT: bindExceptT,
  monadExceptT: monadExceptT,
  monadRecExceptT: monadRecExceptT,
  altExceptT: altExceptT,
  plusExceptT: plusExceptT,
  alternativeExceptT: alternativeExceptT,
  monadPlusExceptT: monadPlusExceptT,
  monadZeroExceptT: monadZeroExceptT,
  monadTransExceptT: monadTransExceptT,
  monadEffectExceptT: monadEffectExceptT,
  monadContExceptT: monadContExceptT,
  monadThrowExceptT: monadThrowExceptT,
  monadErrorExceptT: monadErrorExceptT,
  monadAskExceptT: monadAskExceptT,
  monadReaderExceptT: monadReaderExceptT,
  monadStateExceptT: monadStateExceptT,
  monadTellExceptT: monadTellExceptT,
  monadWriterExceptT: monadWriterExceptT
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Monad.Cont.Class/index.js":"../output/Control.Monad.Cont.Class/index.js","../Control.Monad.Error.Class/index.js":"../output/Control.Monad.Error.Class/index.js","../Control.Monad.Reader.Class/index.js":"../output/Control.Monad.Reader.Class/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Control.Monad.State.Class/index.js":"../output/Control.Monad.State.Class/index.js","../Control.Monad.Trans.Class/index.js":"../output/Control.Monad.Trans.Class/index.js","../Control.Monad.Writer.Class/index.js":"../output/Control.Monad.Writer.Class/index.js","../Control.MonadPlus/index.js":"../output/Control.MonadPlus/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js"}],"../output/Control.Monad.Except/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var withExcept = Control_Monad_Except_Trans.withExceptT(Data_Identity.functorIdentity);

var runExcept = function () {
  var $0 = Data_Newtype.unwrap(Data_Identity.newtypeIdentity);
  return function ($1) {
    return $0(Control_Monad_Except_Trans.runExceptT($1));
  };
}();

var mapExcept = function mapExcept(f) {
  return Control_Monad_Except_Trans.mapExceptT(function () {
    var $2 = Data_Newtype.unwrap(Data_Identity.newtypeIdentity);
    return function ($3) {
      return Data_Identity.Identity(f($2($3)));
    };
  }());
};

module.exports = {
  runExcept: runExcept,
  mapExcept: mapExcept,
  withExcept: withExcept
};
},{"../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js"}],"../output/Data.Unfoldable/foreign.js":[function(require,module,exports) {
"use strict";

exports.unfoldrArrayImpl = function (isNothing) {
  return function (fromJust) {
    return function (fst) {
      return function (snd) {
        return function (f) {
          return function (b) {
            var result = [];
            var value = b;

            while (true) {
              // eslint-disable-line no-constant-condition
              var maybe = f(value);
              if (isNothing(maybe)) return result;
              var tuple = fromJust(maybe);
              result.push(fst(tuple));
              value = snd(tuple);
            }
          };
        };
      };
    };
  };
};
},{}],"../output/Data.Unfoldable1/foreign.js":[function(require,module,exports) {
"use strict";

exports.unfoldr1ArrayImpl = function (isNothing) {
  return function (fromJust) {
    return function (fst) {
      return function (snd) {
        return function (f) {
          return function (b) {
            var result = [];
            var value = b;

            while (true) {
              // eslint-disable-line no-constant-condition
              var tuple = f(value);
              result.push(fst(tuple));
              var maybe = snd(tuple);
              if (isNothing(maybe)) return result;
              value = fromJust(maybe);
            }
          };
        };
      };
    };
  };
};
},{}],"../output/Data.Unfoldable1/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Semigroup_Traversable = require("../Data.Semigroup.Traversable/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Unfoldable1 = function Unfoldable1(unfoldr1) {
  this.unfoldr1 = unfoldr1;
};

var unfoldr1 = function unfoldr1(dict) {
  return dict.unfoldr1;
};

var unfoldable1Maybe = new Unfoldable1(function (f) {
  return function (b) {
    return new Data_Maybe.Just(Data_Tuple.fst(f(b)));
  };
});
var unfoldable1Array = new Unfoldable1($foreign.unfoldr1ArrayImpl(Data_Maybe.isNothing)(Data_Maybe.fromJust())(Data_Tuple.fst)(Data_Tuple.snd));

var replicate1 = function replicate1(dictUnfoldable1) {
  return function (n) {
    return function (v) {
      var step = function step(i) {
        if (i <= 0) {
          return new Data_Tuple.Tuple(v, Data_Maybe.Nothing.value);
        }

        ;

        if (Data_Boolean.otherwise) {
          return new Data_Tuple.Tuple(v, new Data_Maybe.Just(i - 1 | 0));
        }

        ;
        throw new Error("Failed pattern match at Data.Unfoldable1 (line 67, column 5 - line 67, column 39): " + [i.constructor.name]);
      };

      return unfoldr1(dictUnfoldable1)(step)(n - 1 | 0);
    };
  };
};

var replicate1A = function replicate1A(dictApply) {
  return function (dictUnfoldable1) {
    return function (dictTraversable1) {
      return function (n) {
        return function (m) {
          return Data_Semigroup_Traversable.sequence1(dictTraversable1)(dictApply)(replicate1(dictUnfoldable1)(n)(m));
        };
      };
    };
  };
};

var singleton = function singleton(dictUnfoldable1) {
  return replicate1(dictUnfoldable1)(1);
};

var range = function range(dictUnfoldable1) {
  return function (start) {
    return function (end) {
      var go = function go(delta) {
        return function (i) {
          var i$prime = i + delta | 0;
          return new Data_Tuple.Tuple(i, function () {
            var $8 = i === end;

            if ($8) {
              return Data_Maybe.Nothing.value;
            }

            ;
            return new Data_Maybe.Just(i$prime);
          }());
        };
      };

      var delta = function () {
        var $9 = end >= start;

        if ($9) {
          return 1;
        }

        ;
        return -1 | 0;
      }();

      return unfoldr1(dictUnfoldable1)(go(delta))(start);
    };
  };
};

module.exports = {
  Unfoldable1: Unfoldable1,
  unfoldr1: unfoldr1,
  replicate1: replicate1,
  replicate1A: replicate1A,
  singleton: singleton,
  range: range,
  unfoldable1Array: unfoldable1Array,
  unfoldable1Maybe: unfoldable1Maybe
};
},{"./foreign.js":"../output/Data.Unfoldable1/foreign.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Semigroup.Traversable/index.js":"../output/Data.Semigroup.Traversable/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Unfoldable/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable1 = require("../Data.Unfoldable1/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Unfoldable = function Unfoldable(Unfoldable10, unfoldr) {
  this.Unfoldable10 = Unfoldable10;
  this.unfoldr = unfoldr;
};

var unfoldr = function unfoldr(dict) {
  return dict.unfoldr;
};

var unfoldableMaybe = new Unfoldable(function () {
  return Data_Unfoldable1.unfoldable1Maybe;
}, function (f) {
  return function (b) {
    return Data_Functor.map(Data_Maybe.functorMaybe)(Data_Tuple.fst)(f(b));
  };
});
var unfoldableArray = new Unfoldable(function () {
  return Data_Unfoldable1.unfoldable1Array;
}, $foreign.unfoldrArrayImpl(Data_Maybe.isNothing)(Data_Maybe.fromJust())(Data_Tuple.fst)(Data_Tuple.snd));

var replicate = function replicate(dictUnfoldable) {
  return function (n) {
    return function (v) {
      var step = function step(i) {
        var $7 = i <= 0;

        if ($7) {
          return Data_Maybe.Nothing.value;
        }

        ;
        return new Data_Maybe.Just(new Data_Tuple.Tuple(v, i - 1 | 0));
      };

      return unfoldr(dictUnfoldable)(step)(n);
    };
  };
};

var replicateA = function replicateA(dictApplicative) {
  return function (dictUnfoldable) {
    return function (dictTraversable) {
      return function (n) {
        return function (m) {
          return Data_Traversable.sequence(dictTraversable)(dictApplicative)(replicate(dictUnfoldable)(n)(m));
        };
      };
    };
  };
};

var none = function none(dictUnfoldable) {
  return unfoldr(dictUnfoldable)(Data_Function["const"](Data_Maybe.Nothing.value))(Data_Unit.unit);
};

var fromMaybe = function fromMaybe(dictUnfoldable) {
  return unfoldr(dictUnfoldable)(function (b) {
    return Data_Functor.map(Data_Maybe.functorMaybe)(Data_Function.flip(Data_Tuple.Tuple.create)(Data_Maybe.Nothing.value))(b);
  });
};

module.exports = {
  Unfoldable: Unfoldable,
  unfoldr: unfoldr,
  replicate: replicate,
  replicateA: replicateA,
  none: none,
  fromMaybe: fromMaybe,
  unfoldableArray: unfoldableArray,
  unfoldableMaybe: unfoldableMaybe
};
},{"./foreign.js":"../output/Data.Unfoldable/foreign.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable1/index.js":"../output/Data.Unfoldable1/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.NonEmpty/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semigroup_Foldable = require("../Data.Semigroup.Foldable/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Data_Unfoldable1 = require("../Data.Unfoldable1/index.js");

var NonEmpty = function () {
  function NonEmpty(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  NonEmpty.create = function (value0) {
    return function (value1) {
      return new NonEmpty(value0, value1);
    };
  };

  return NonEmpty;
}();

var unfoldable1NonEmpty = function unfoldable1NonEmpty(dictUnfoldable) {
  return new Data_Unfoldable1.Unfoldable1(function (f) {
    return function (b) {
      return Data_Tuple.uncurry(NonEmpty.create)(Data_Functor.map(Data_Tuple.functorTuple)(Data_Unfoldable.unfoldr(dictUnfoldable)(Data_Functor.map(Data_Maybe.functorMaybe)(f)))(f(b)));
    };
  });
};

var tail = function tail(v) {
  return v.value1;
};

var singleton = function singleton(dictPlus) {
  return function (a) {
    return new NonEmpty(a, Control_Plus.empty(dictPlus));
  };
};

var showNonEmpty = function showNonEmpty(dictShow) {
  return function (dictShow1) {
    return new Data_Show.Show(function (v) {
      return "(NonEmpty " + (Data_Show.show(dictShow)(v.value0) + (" " + (Data_Show.show(dictShow1)(v.value1) + ")")));
    });
  };
};

var oneOf = function oneOf(dictAlternative) {
  return function (v) {
    return Control_Alt.alt(dictAlternative.Plus1().Alt0())(Control_Applicative.pure(dictAlternative.Applicative0())(v.value0))(v.value1);
  };
};

var head = function head(v) {
  return v.value0;
};

var functorNonEmpty = function functorNonEmpty(dictFunctor) {
  return new Data_Functor.Functor(function (f) {
    return function (m) {
      return new NonEmpty(f(m.value0), Data_Functor.map(dictFunctor)(f)(m.value1));
    };
  });
};

var functorWithIndex = function functorWithIndex(dictFunctorWithIndex) {
  return new Data_FunctorWithIndex.FunctorWithIndex(function () {
    return functorNonEmpty(dictFunctorWithIndex.Functor0());
  }, function (f) {
    return function (v) {
      return new NonEmpty(f(Data_Maybe.Nothing.value)(v.value0), Data_FunctorWithIndex.mapWithIndex(dictFunctorWithIndex)(function ($146) {
        return f(Data_Maybe.Just.create($146));
      })(v.value1));
    };
  });
};

var fromNonEmpty = function fromNonEmpty(f) {
  return function (v) {
    return f(v.value0)(v.value1);
  };
};

var foldl1 = function foldl1(dictFoldable) {
  return function (f) {
    return function (v) {
      return Data_Foldable.foldl(dictFoldable)(f)(v.value0)(v.value1);
    };
  };
};

var foldableNonEmpty = function foldableNonEmpty(dictFoldable) {
  return new Data_Foldable.Foldable(function (dictMonoid) {
    return function (f) {
      return function (v) {
        return Data_Semigroup.append(dictMonoid.Semigroup0())(f(v.value0))(Data_Foldable.foldMap(dictFoldable)(dictMonoid)(f)(v.value1));
      };
    };
  }, function (f) {
    return function (b) {
      return function (v) {
        return Data_Foldable.foldl(dictFoldable)(f)(f(b)(v.value0))(v.value1);
      };
    };
  }, function (f) {
    return function (b) {
      return function (v) {
        return f(v.value0)(Data_Foldable.foldr(dictFoldable)(f)(b)(v.value1));
      };
    };
  });
};

var foldableWithIndexNonEmpty = function foldableWithIndexNonEmpty(dictFoldableWithIndex) {
  return new Data_FoldableWithIndex.FoldableWithIndex(function () {
    return foldableNonEmpty(dictFoldableWithIndex.Foldable0());
  }, function (dictMonoid) {
    return function (f) {
      return function (v) {
        return Data_Semigroup.append(dictMonoid.Semigroup0())(f(Data_Maybe.Nothing.value)(v.value0))(Data_FoldableWithIndex.foldMapWithIndex(dictFoldableWithIndex)(dictMonoid)(function ($147) {
          return f(Data_Maybe.Just.create($147));
        })(v.value1));
      };
    };
  }, function (f) {
    return function (b) {
      return function (v) {
        return Data_FoldableWithIndex.foldlWithIndex(dictFoldableWithIndex)(function ($148) {
          return f(Data_Maybe.Just.create($148));
        })(f(Data_Maybe.Nothing.value)(b)(v.value0))(v.value1);
      };
    };
  }, function (f) {
    return function (b) {
      return function (v) {
        return f(Data_Maybe.Nothing.value)(v.value0)(Data_FoldableWithIndex.foldrWithIndex(dictFoldableWithIndex)(function ($149) {
          return f(Data_Maybe.Just.create($149));
        })(b)(v.value1));
      };
    };
  });
};

var traversableNonEmpty = function traversableNonEmpty(dictTraversable) {
  return new Data_Traversable.Traversable(function () {
    return foldableNonEmpty(dictTraversable.Foldable1());
  }, function () {
    return functorNonEmpty(dictTraversable.Functor0());
  }, function (dictApplicative) {
    return function (v) {
      return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(NonEmpty.create)(v.value0))(Data_Traversable.sequence(dictTraversable)(dictApplicative)(v.value1));
    };
  }, function (dictApplicative) {
    return function (f) {
      return function (v) {
        return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(NonEmpty.create)(f(v.value0)))(Data_Traversable.traverse(dictTraversable)(dictApplicative)(f)(v.value1));
      };
    };
  });
};

var traversableWithIndexNonEmpty = function traversableWithIndexNonEmpty(dictTraversableWithIndex) {
  return new Data_TraversableWithIndex.TraversableWithIndex(function () {
    return foldableWithIndexNonEmpty(dictTraversableWithIndex.FoldableWithIndex1());
  }, function () {
    return functorWithIndex(dictTraversableWithIndex.FunctorWithIndex0());
  }, function () {
    return traversableNonEmpty(dictTraversableWithIndex.Traversable2());
  }, function (dictApplicative) {
    return function (f) {
      return function (v) {
        return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(NonEmpty.create)(f(Data_Maybe.Nothing.value)(v.value0)))(Data_TraversableWithIndex.traverseWithIndex(dictTraversableWithIndex)(dictApplicative)(function ($150) {
          return f(Data_Maybe.Just.create($150));
        })(v.value1));
      };
    };
  });
};

var foldable1NonEmpty = function foldable1NonEmpty(dictFoldable) {
  return new Data_Semigroup_Foldable.Foldable1(function () {
    return foldableNonEmpty(dictFoldable);
  }, function (dictSemigroup) {
    return Data_Semigroup_Foldable.foldMap1(foldable1NonEmpty(dictFoldable))(dictSemigroup)(Control_Category.identity(Control_Category.categoryFn));
  }, function (dictSemigroup) {
    return function (f) {
      return function (v) {
        return Data_Foldable.foldl(dictFoldable)(function (s) {
          return function (a1) {
            return Data_Semigroup.append(dictSemigroup)(s)(f(a1));
          };
        })(f(v.value0))(v.value1);
      };
    };
  });
};

var eqNonEmpty = function eqNonEmpty(dictEq1) {
  return function (dictEq) {
    return new Data_Eq.Eq(function (x) {
      return function (y) {
        return Data_Eq.eq(dictEq)(x.value0)(y.value0) && Data_Eq.eq1(dictEq1)(dictEq)(x.value1)(y.value1);
      };
    });
  };
};

var ordNonEmpty = function ordNonEmpty(dictOrd1) {
  return function (dictOrd) {
    return new Data_Ord.Ord(function () {
      return eqNonEmpty(dictOrd1.Eq10())(dictOrd.Eq0());
    }, function (x) {
      return function (y) {
        var v = Data_Ord.compare(dictOrd)(x.value0)(y.value0);

        if (v instanceof Data_Ordering.LT) {
          return Data_Ordering.LT.value;
        }

        ;

        if (v instanceof Data_Ordering.GT) {
          return Data_Ordering.GT.value;
        }

        ;
        return Data_Ord.compare1(dictOrd1)(dictOrd)(x.value1)(y.value1);
      };
    });
  };
};

var eq1NonEmpty = function eq1NonEmpty(dictEq1) {
  return new Data_Eq.Eq1(function (dictEq) {
    return Data_Eq.eq(eqNonEmpty(dictEq1)(dictEq));
  });
};

var ord1NonEmpty = function ord1NonEmpty(dictOrd1) {
  return new Data_Ord.Ord1(function () {
    return eq1NonEmpty(dictOrd1.Eq10());
  }, function (dictOrd) {
    return Data_Ord.compare(ordNonEmpty(dictOrd1)(dictOrd));
  });
};

module.exports = {
  NonEmpty: NonEmpty,
  singleton: singleton,
  foldl1: foldl1,
  fromNonEmpty: fromNonEmpty,
  oneOf: oneOf,
  head: head,
  tail: tail,
  showNonEmpty: showNonEmpty,
  eqNonEmpty: eqNonEmpty,
  eq1NonEmpty: eq1NonEmpty,
  ordNonEmpty: ordNonEmpty,
  ord1NonEmpty: ord1NonEmpty,
  functorNonEmpty: functorNonEmpty,
  functorWithIndex: functorWithIndex,
  foldableNonEmpty: foldableNonEmpty,
  foldableWithIndexNonEmpty: foldableWithIndexNonEmpty,
  traversableNonEmpty: traversableNonEmpty,
  traversableWithIndexNonEmpty: traversableWithIndexNonEmpty,
  foldable1NonEmpty: foldable1NonEmpty,
  unfoldable1NonEmpty: unfoldable1NonEmpty
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semigroup.Foldable/index.js":"../output/Data.Semigroup.Foldable/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js","../Data.Unfoldable1/index.js":"../output/Data.Unfoldable1/index.js"}],"../output/Data.List.Types/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Comonad = require("../Control.Comonad/index.js");

var Control_Extend = require("../Control.Extend/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_MonadPlus = require("../Control.MonadPlus/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_NonEmpty = require("../Data.NonEmpty/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semigroup_Traversable = require("../Data.Semigroup.Traversable/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Data_Unfoldable1 = require("../Data.Unfoldable1/index.js");

var Nil = function () {
  function Nil() {}

  ;
  Nil.value = new Nil();
  return Nil;
}();

var Cons = function () {
  function Cons(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Cons.create = function (value0) {
    return function (value1) {
      return new Cons(value0, value1);
    };
  };

  return Cons;
}();

var NonEmptyList = function NonEmptyList(x) {
  return x;
};

var toList = function toList(v) {
  return new Cons(v.value0, v.value1);
};

var newtypeNonEmptyList = new Data_Newtype.Newtype(function (n) {
  return n;
}, NonEmptyList);

var nelCons = function nelCons(a) {
  return function (v) {
    return new Data_NonEmpty.NonEmpty(a, new Cons(v.value0, v.value1));
  };
};

var listMap = function listMap(f) {
  var chunkedRevMap = function chunkedRevMap($copy_chunksAcc) {
    return function ($copy_v) {
      var $tco_var_chunksAcc = $copy_chunksAcc;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(chunksAcc, v) {
        if (v instanceof Cons && v.value1 instanceof Cons && v.value1.value1 instanceof Cons) {
          $tco_var_chunksAcc = new Cons(v, chunksAcc);
          $copy_v = v.value1.value1.value1;
          return;
        }

        ;

        var unrolledMap = function unrolledMap(v1) {
          if (v1 instanceof Cons && v1.value1 instanceof Cons && v1.value1.value1 instanceof Nil) {
            return new Cons(f(v1.value0), new Cons(f(v1.value1.value0), Nil.value));
          }

          ;

          if (v1 instanceof Cons && v1.value1 instanceof Nil) {
            return new Cons(f(v1.value0), Nil.value);
          }

          ;
          return Nil.value;
        };

        var reverseUnrolledMap = function reverseUnrolledMap($copy_v1) {
          return function ($copy_acc) {
            var $tco_var_v1 = $copy_v1;
            var $tco_done = false;
            var $tco_result;

            function $tco_loop(v1, acc) {
              if (v1 instanceof Cons && v1.value0 instanceof Cons && v1.value0.value1 instanceof Cons && v1.value0.value1.value1 instanceof Cons) {
                $tco_var_v1 = v1.value1;
                $copy_acc = new Cons(f(v1.value0.value0), new Cons(f(v1.value0.value1.value0), new Cons(f(v1.value0.value1.value1.value0), acc)));
                return;
              }

              ;
              $tco_done = true;
              return acc;
            }

            ;

            while (!$tco_done) {
              $tco_result = $tco_loop($tco_var_v1, $copy_acc);
            }

            ;
            return $tco_result;
          };
        };

        $tco_done = true;
        return reverseUnrolledMap(chunksAcc)(unrolledMap(v));
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_chunksAcc, $copy_v);
      }

      ;
      return $tco_result;
    };
  };

  return chunkedRevMap(Nil.value);
};

var functorList = new Data_Functor.Functor(listMap);
var functorNonEmptyList = Data_NonEmpty.functorNonEmpty(functorList);
var foldableList = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldl(foldableList)(function (acc) {
      var $202 = Data_Semigroup.append(dictMonoid.Semigroup0())(acc);
      return function ($203) {
        return $202(f($203));
      };
    })(Data_Monoid.mempty(dictMonoid));
  };
}, function (f) {
  var go = function go($copy_b) {
    return function ($copy_v) {
      var $tco_var_b = $copy_b;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(b, v) {
        if (v instanceof Nil) {
          $tco_done = true;
          return b;
        }

        ;

        if (v instanceof Cons) {
          $tco_var_b = f(b)(v.value0);
          $copy_v = v.value1;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Types (line 109, column 12 - line 111, column 30): " + [v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_b, $copy_v);
      }

      ;
      return $tco_result;
    };
  };

  return go;
}, function (f) {
  return function (b) {
    var rev = Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value);
    var $204 = Data_Foldable.foldl(foldableList)(Data_Function.flip(f))(b);
    return function ($205) {
      return $204(rev($205));
    };
  };
});
var foldableNonEmptyList = Data_NonEmpty.foldableNonEmpty(foldableList);
var foldableWithIndexList = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableList;
}, function (dictMonoid) {
  return function (f) {
    return Data_FoldableWithIndex.foldlWithIndex(foldableWithIndexList)(function (i) {
      return function (acc) {
        var $206 = Data_Semigroup.append(dictMonoid.Semigroup0())(acc);
        var $207 = f(i);
        return function ($208) {
          return $206($207($208));
        };
      };
    })(Data_Monoid.mempty(dictMonoid));
  };
}, function (f) {
  return function (acc) {
    var $209 = Data_Foldable.foldl(foldableList)(function (v) {
      return function (a) {
        return new Data_Tuple.Tuple(v.value0 + 1 | 0, f(v.value0)(v.value1)(a));
      };
    })(new Data_Tuple.Tuple(0, acc));
    return function ($210) {
      return Data_Tuple.snd($209($210));
    };
  };
}, function (f) {
  return function (b) {
    return function (xs) {
      var v = function () {
        var rev = Data_Foldable.foldl(foldableList)(function (v1) {
          return function (a) {
            return new Data_Tuple.Tuple(v1.value0 + 1 | 0, new Cons(a, v1.value1));
          };
        });
        return rev(new Data_Tuple.Tuple(0, Nil.value))(xs);
      }();

      return Data_Tuple.snd(Data_Foldable.foldl(foldableList)(function (v1) {
        return function (a) {
          return new Data_Tuple.Tuple(v1.value0 - 1 | 0, f(v1.value0 - 1 | 0)(a)(v1.value1));
        };
      })(new Data_Tuple.Tuple(v.value0, b))(v.value1));
    };
  };
});
var foldableWithIndexNonEmptyList = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableNonEmptyList;
}, function (dictMonoid) {
  return function (f) {
    return function (v) {
      return Data_FoldableWithIndex.foldMapWithIndex(Data_NonEmpty.foldableWithIndexNonEmpty(foldableWithIndexList))(dictMonoid)(function () {
        var $211 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($212) {
          return f($211($212));
        };
      }())(v);
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return Data_FoldableWithIndex.foldlWithIndex(Data_NonEmpty.foldableWithIndexNonEmpty(foldableWithIndexList))(function () {
        var $213 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($214) {
          return f($213($214));
        };
      }())(b)(v);
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return Data_FoldableWithIndex.foldrWithIndex(Data_NonEmpty.foldableWithIndexNonEmpty(foldableWithIndexList))(function () {
        var $215 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($216) {
          return f($215($216));
        };
      }())(b)(v);
    };
  };
});
var functorWithIndexList = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorList;
}, function (f) {
  return Data_FoldableWithIndex.foldrWithIndex(foldableWithIndexList)(function (i) {
    return function (x) {
      return function (acc) {
        return new Cons(f(i)(x), acc);
      };
    };
  })(Nil.value);
});
var functorWithIndexNonEmptyList = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorNonEmptyList;
}, function (fn) {
  return function (v) {
    return NonEmptyList(Data_FunctorWithIndex.mapWithIndex(Data_NonEmpty.functorWithIndex(functorWithIndexList))(function () {
      var $217 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
      return function ($218) {
        return fn($217($218));
      };
    }())(v));
  };
});
var semigroupList = new Data_Semigroup.Semigroup(function (xs) {
  return function (ys) {
    return Data_Foldable.foldr(foldableList)(Cons.create)(ys)(xs);
  };
});
var monoidList = new Data_Monoid.Monoid(function () {
  return semigroupList;
}, Nil.value);
var semigroupNonEmptyList = new Data_Semigroup.Semigroup(function (v) {
  return function (as$prime) {
    return new Data_NonEmpty.NonEmpty(v.value0, Data_Semigroup.append(semigroupList)(v.value1)(toList(as$prime)));
  };
});

var showList = function showList(dictShow) {
  return new Data_Show.Show(function (v) {
    if (v instanceof Nil) {
      return "Nil";
    }

    ;
    return "(" + (Data_Foldable.intercalate(foldableList)(Data_Monoid.monoidString)(" : ")(Data_Functor.map(functorList)(Data_Show.show(dictShow))(v)) + " : Nil)");
  });
};

var showNonEmptyList = function showNonEmptyList(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(NonEmptyList " + (Data_Show.show(Data_NonEmpty.showNonEmpty(dictShow)(showList(dictShow)))(v) + ")");
  });
};

var traversableList = new Data_Traversable.Traversable(function () {
  return foldableList;
}, function () {
  return functorList;
}, function (dictApplicative) {
  return Data_Traversable.traverse(traversableList)(dictApplicative)(Control_Category.identity(Control_Category.categoryFn));
}, function (dictApplicative) {
  return function (f) {
    var $219 = Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value));
    var $220 = Data_Foldable.foldl(foldableList)(function (acc) {
      var $222 = Control_Apply.lift2(dictApplicative.Apply0())(Data_Function.flip(Cons.create))(acc);
      return function ($223) {
        return $222(f($223));
      };
    })(Control_Applicative.pure(dictApplicative)(Nil.value));
    return function ($221) {
      return $219($220($221));
    };
  };
});
var traversableNonEmptyList = Data_NonEmpty.traversableNonEmpty(traversableList);
var traversableWithIndexList = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexList;
}, function () {
  return functorWithIndexList;
}, function () {
  return traversableList;
}, function (dictApplicative) {
  return function (f) {
    var rev = Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value);
    var $224 = Data_Functor.map(dictApplicative.Apply0().Functor0())(rev);
    var $225 = Data_FoldableWithIndex.foldlWithIndex(foldableWithIndexList)(function (i) {
      return function (acc) {
        var $227 = Control_Apply.lift2(dictApplicative.Apply0())(Data_Function.flip(Cons.create))(acc);
        var $228 = f(i);
        return function ($229) {
          return $227($228($229));
        };
      };
    })(Control_Applicative.pure(dictApplicative)(Nil.value));
    return function ($226) {
      return $224($225($226));
    };
  };
});
var traversableWithIndexNonEmptyList = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexNonEmptyList;
}, function () {
  return functorWithIndexNonEmptyList;
}, function () {
  return traversableNonEmptyList;
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(NonEmptyList)(Data_TraversableWithIndex.traverseWithIndex(Data_NonEmpty.traversableWithIndexNonEmpty(traversableWithIndexList))(dictApplicative)(function () {
        var $230 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($231) {
          return f($230($231));
        };
      }())(v));
    };
  };
});
var unfoldable1List = new Data_Unfoldable1.Unfoldable1(function (f) {
  return function (b) {
    var go = function go($copy_source) {
      return function ($copy_memo) {
        var $tco_var_source = $copy_source;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(source, memo) {
          var v = f(source);

          if (v.value1 instanceof Data_Maybe.Just) {
            $tco_var_source = v.value1.value0;
            $copy_memo = new Cons(v.value0, memo);
            return;
          }

          ;

          if (v.value1 instanceof Data_Maybe.Nothing) {
            $tco_done = true;
            return Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value)(new Cons(v.value0, memo));
          }

          ;
          throw new Error("Failed pattern match at Data.List.Types (line 133, column 22 - line 135, column 61): " + [v.constructor.name]);
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_source, $copy_memo);
        }

        ;
        return $tco_result;
      };
    };

    return go(b)(Nil.value);
  };
});
var unfoldableList = new Data_Unfoldable.Unfoldable(function () {
  return unfoldable1List;
}, function (f) {
  return function (b) {
    var go = function go($copy_source) {
      return function ($copy_memo) {
        var $tco_var_source = $copy_source;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(source, memo) {
          var v = f(source);

          if (v instanceof Data_Maybe.Nothing) {
            $tco_done = true;
            return Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value)(memo);
          }

          ;

          if (v instanceof Data_Maybe.Just) {
            $tco_var_source = v.value0.value1;
            $copy_memo = new Cons(v.value0.value0, memo);
            return;
          }

          ;
          throw new Error("Failed pattern match at Data.List.Types (line 140, column 22 - line 142, column 52): " + [v.constructor.name]);
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_source, $copy_memo);
        }

        ;
        return $tco_result;
      };
    };

    return go(b)(Nil.value);
  };
});
var unfoldable1NonEmptyList = Data_NonEmpty.unfoldable1NonEmpty(unfoldableList);
var foldable1NonEmptyList = Data_NonEmpty.foldable1NonEmpty(foldableList);
var extendNonEmptyList = new Control_Extend.Extend(function () {
  return functorNonEmptyList;
}, function (f) {
  return function (v) {
    var go = function go(a) {
      return function (v1) {
        return {
          val: new Cons(f(new Data_NonEmpty.NonEmpty(a, v1.acc)), v1.val),
          acc: new Cons(a, v1.acc)
        };
      };
    };

    return new Data_NonEmpty.NonEmpty(f(v), Data_Foldable.foldr(foldableList)(go)({
      val: Nil.value,
      acc: Nil.value
    })(v.value1).val);
  };
});
var extendList = new Control_Extend.Extend(function () {
  return functorList;
}, function (f) {
  return function (v) {
    if (v instanceof Nil) {
      return Nil.value;
    }

    ;

    if (v instanceof Cons) {
      var go = function go(a$prime) {
        return function (v1) {
          var acc$prime = new Cons(a$prime, v1.acc);
          return {
            val: new Cons(f(acc$prime), v1.val),
            acc: acc$prime
          };
        };
      };

      return new Cons(f(v), Data_Foldable.foldr(foldableList)(go)({
        val: Nil.value,
        acc: Nil.value
      })(v.value1).val);
    }

    ;
    throw new Error("Failed pattern match at Data.List.Types (line 180, column 1 - line 187, column 42): " + [f.constructor.name, v.constructor.name]);
  };
});
var eq1List = new Data_Eq.Eq1(function (dictEq) {
  return function (xs) {
    return function (ys) {
      var go = function go($copy_v) {
        return function ($copy_v1) {
          return function ($copy_v2) {
            var $tco_var_v = $copy_v;
            var $tco_var_v1 = $copy_v1;
            var $tco_done = false;
            var $tco_result;

            function $tco_loop(v, v1, v2) {
              if (!v2) {
                $tco_done = true;
                return false;
              }

              ;

              if (v instanceof Nil && v1 instanceof Nil) {
                $tco_done = true;
                return v2;
              }

              ;

              if (v instanceof Cons && v1 instanceof Cons) {
                $tco_var_v = v.value1;
                $tco_var_v1 = v1.value1;
                $copy_v2 = v2 && Data_Eq.eq(dictEq)(v1.value0)(v.value0);
                return;
              }

              ;
              $tco_done = true;
              return false;
            }

            ;

            while (!$tco_done) {
              $tco_result = $tco_loop($tco_var_v, $tco_var_v1, $copy_v2);
            }

            ;
            return $tco_result;
          };
        };
      };

      return go(xs)(ys)(true);
    };
  };
});

var eqList = function eqList(dictEq) {
  return new Data_Eq.Eq(Data_Eq.eq1(eq1List)(dictEq));
};

var eqNonEmptyList = function eqNonEmptyList(dictEq) {
  return Data_NonEmpty.eqNonEmpty(eq1List)(dictEq);
};

var ord1List = new Data_Ord.Ord1(function () {
  return eq1List;
}, function (dictOrd) {
  return function (xs) {
    return function (ys) {
      var go = function go($copy_v) {
        return function ($copy_v1) {
          var $tco_var_v = $copy_v;
          var $tco_done = false;
          var $tco_result;

          function $tco_loop(v, v1) {
            if (v instanceof Nil && v1 instanceof Nil) {
              $tco_done = true;
              return Data_Ordering.EQ.value;
            }

            ;

            if (v instanceof Nil) {
              $tco_done = true;
              return Data_Ordering.LT.value;
            }

            ;

            if (v1 instanceof Nil) {
              $tco_done = true;
              return Data_Ordering.GT.value;
            }

            ;

            if (v instanceof Cons && v1 instanceof Cons) {
              var v2 = Data_Ord.compare(dictOrd)(v.value0)(v1.value0);

              if (v2 instanceof Data_Ordering.EQ) {
                $tco_var_v = v.value1;
                $copy_v1 = v1.value1;
                return;
              }

              ;
              $tco_done = true;
              return v2;
            }

            ;
            throw new Error("Failed pattern match at Data.List.Types (line 61, column 5 - line 61, column 20): " + [v.constructor.name, v1.constructor.name]);
          }

          ;

          while (!$tco_done) {
            $tco_result = $tco_loop($tco_var_v, $copy_v1);
          }

          ;
          return $tco_result;
        };
      };

      return go(xs)(ys);
    };
  };
});

var ordList = function ordList(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqList(dictOrd.Eq0());
  }, Data_Ord.compare1(ord1List)(dictOrd));
};

var ordNonEmptyList = function ordNonEmptyList(dictOrd) {
  return Data_NonEmpty.ordNonEmpty(ord1List)(dictOrd);
};

var comonadNonEmptyList = new Control_Comonad.Comonad(function () {
  return extendNonEmptyList;
}, function (v) {
  return v.value0;
});
var applyList = new Control_Apply.Apply(function () {
  return functorList;
}, function (v) {
  return function (v1) {
    if (v instanceof Nil) {
      return Nil.value;
    }

    ;

    if (v instanceof Cons) {
      return Data_Semigroup.append(semigroupList)(Data_Functor.map(functorList)(v.value0)(v1))(Control_Apply.apply(applyList)(v.value1)(v1));
    }

    ;
    throw new Error("Failed pattern match at Data.List.Types (line 155, column 1 - line 157, column 48): " + [v.constructor.name, v1.constructor.name]);
  };
});
var applyNonEmptyList = new Control_Apply.Apply(function () {
  return functorNonEmptyList;
}, function (v) {
  return function (v1) {
    return new Data_NonEmpty.NonEmpty(v.value0(v1.value0), Data_Semigroup.append(semigroupList)(Control_Apply.apply(applyList)(v.value1)(new Cons(v1.value0, Nil.value)))(Control_Apply.apply(applyList)(new Cons(v.value0, v.value1))(v1.value1)));
  };
});
var bindList = new Control_Bind.Bind(function () {
  return applyList;
}, function (v) {
  return function (v1) {
    if (v instanceof Nil) {
      return Nil.value;
    }

    ;

    if (v instanceof Cons) {
      return Data_Semigroup.append(semigroupList)(v1(v.value0))(Control_Bind.bind(bindList)(v.value1)(v1));
    }

    ;
    throw new Error("Failed pattern match at Data.List.Types (line 162, column 1 - line 164, column 37): " + [v.constructor.name, v1.constructor.name]);
  };
});
var bindNonEmptyList = new Control_Bind.Bind(function () {
  return applyNonEmptyList;
}, function (v) {
  return function (f) {
    var v1 = f(v.value0);
    return new Data_NonEmpty.NonEmpty(v1.value0, Data_Semigroup.append(semigroupList)(v1.value1)(Control_Bind.bind(bindList)(v.value1)(function ($232) {
      return toList(f($232));
    })));
  };
});
var applicativeList = new Control_Applicative.Applicative(function () {
  return applyList;
}, function (a) {
  return new Cons(a, Nil.value);
});
var monadList = new Control_Monad.Monad(function () {
  return applicativeList;
}, function () {
  return bindList;
});
var altNonEmptyList = new Control_Alt.Alt(function () {
  return functorNonEmptyList;
}, Data_Semigroup.append(semigroupNonEmptyList));
var altList = new Control_Alt.Alt(function () {
  return functorList;
}, Data_Semigroup.append(semigroupList));
var plusList = new Control_Plus.Plus(function () {
  return altList;
}, Nil.value);
var alternativeList = new Control_Alternative.Alternative(function () {
  return applicativeList;
}, function () {
  return plusList;
});
var monadZeroList = new Control_MonadZero.MonadZero(function () {
  return alternativeList;
}, function () {
  return monadList;
});
var monadPlusList = new Control_MonadPlus.MonadPlus(function () {
  return monadZeroList;
});
var applicativeNonEmptyList = new Control_Applicative.Applicative(function () {
  return applyNonEmptyList;
}, function () {
  var $233 = Data_NonEmpty.singleton(plusList);
  return function ($234) {
    return NonEmptyList($233($234));
  };
}());
var monadNonEmptyList = new Control_Monad.Monad(function () {
  return applicativeNonEmptyList;
}, function () {
  return bindNonEmptyList;
});
var traversable1NonEmptyList = new Data_Semigroup_Traversable.Traversable1(function () {
  return foldable1NonEmptyList;
}, function () {
  return traversableNonEmptyList;
}, function (dictApply) {
  return Data_Semigroup_Traversable.traverse1(traversable1NonEmptyList)(dictApply)(Control_Category.identity(Control_Category.categoryFn));
}, function (dictApply) {
  return function (f) {
    return function (v) {
      return Data_Functor.mapFlipped(dictApply.Functor0())(Data_Foldable.foldl(foldableList)(function (acc) {
        var $235 = Control_Apply.lift2(dictApply)(Data_Function.flip(nelCons))(acc);
        return function ($236) {
          return $235(f($236));
        };
      })(Data_Functor.map(dictApply.Functor0())(Control_Applicative.pure(applicativeNonEmptyList))(f(v.value0)))(v.value1))(function (v1) {
        return Data_Foldable.foldl(foldableList)(Data_Function.flip(nelCons))(Control_Applicative.pure(applicativeNonEmptyList)(v1.value0))(v1.value1);
      });
    };
  };
});
module.exports = {
  Nil: Nil,
  Cons: Cons,
  NonEmptyList: NonEmptyList,
  toList: toList,
  nelCons: nelCons,
  showList: showList,
  eqList: eqList,
  eq1List: eq1List,
  ordList: ordList,
  ord1List: ord1List,
  semigroupList: semigroupList,
  monoidList: monoidList,
  functorList: functorList,
  functorWithIndexList: functorWithIndexList,
  foldableList: foldableList,
  foldableWithIndexList: foldableWithIndexList,
  unfoldable1List: unfoldable1List,
  unfoldableList: unfoldableList,
  traversableList: traversableList,
  traversableWithIndexList: traversableWithIndexList,
  applyList: applyList,
  applicativeList: applicativeList,
  bindList: bindList,
  monadList: monadList,
  altList: altList,
  plusList: plusList,
  alternativeList: alternativeList,
  monadZeroList: monadZeroList,
  monadPlusList: monadPlusList,
  extendList: extendList,
  newtypeNonEmptyList: newtypeNonEmptyList,
  eqNonEmptyList: eqNonEmptyList,
  ordNonEmptyList: ordNonEmptyList,
  showNonEmptyList: showNonEmptyList,
  functorNonEmptyList: functorNonEmptyList,
  applyNonEmptyList: applyNonEmptyList,
  applicativeNonEmptyList: applicativeNonEmptyList,
  bindNonEmptyList: bindNonEmptyList,
  monadNonEmptyList: monadNonEmptyList,
  altNonEmptyList: altNonEmptyList,
  extendNonEmptyList: extendNonEmptyList,
  comonadNonEmptyList: comonadNonEmptyList,
  semigroupNonEmptyList: semigroupNonEmptyList,
  foldableNonEmptyList: foldableNonEmptyList,
  traversableNonEmptyList: traversableNonEmptyList,
  foldable1NonEmptyList: foldable1NonEmptyList,
  unfoldable1NonEmptyList: unfoldable1NonEmptyList,
  functorWithIndexNonEmptyList: functorWithIndexNonEmptyList,
  foldableWithIndexNonEmptyList: foldableWithIndexNonEmptyList,
  traversableWithIndexNonEmptyList: traversableWithIndexNonEmptyList,
  traversable1NonEmptyList: traversable1NonEmptyList
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Comonad/index.js":"../output/Control.Comonad/index.js","../Control.Extend/index.js":"../output/Control.Extend/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.MonadPlus/index.js":"../output/Control.MonadPlus/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.NonEmpty/index.js":"../output/Data.NonEmpty/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semigroup.Traversable/index.js":"../output/Data.Semigroup.Traversable/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js","../Data.Unfoldable1/index.js":"../output/Data.Unfoldable1/index.js"}],"../output/Foreign/foreign.js":[function(require,module,exports) {
"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

exports.unsafeToForeign = function (value) {
  return value;
};

exports.unsafeFromForeign = function (value) {
  return value;
};

exports.typeOf = function (value) {
  return _typeof(value);
};

exports.tagOf = function (value) {
  return Object.prototype.toString.call(value).slice(8, -1);
};

exports.isNull = function (value) {
  return value === null;
};

exports.isUndefined = function (value) {
  return value === undefined;
};

exports.isArray = Array.isArray || function (value) {
  return Object.prototype.toString.call(value) === "[object Array]";
};
},{}],"../output/Data.Int/foreign.js":[function(require,module,exports) {
"use strict";

exports.fromNumberImpl = function (just) {
  return function (nothing) {
    return function (n) {
      /* jshint bitwise: false */
      return (n | 0) === n ? just(n) : nothing;
    };
  };
};

exports.toNumber = function (n) {
  return n;
};

exports.fromStringAsImpl = function (just) {
  return function (nothing) {
    return function (radix) {
      var digits;

      if (radix < 11) {
        digits = "[0-" + (radix - 1).toString() + "]";
      } else if (radix === 11) {
        digits = "[0-9a]";
      } else {
        digits = "[0-9a-" + String.fromCharCode(86 + radix) + "]";
      }

      var pattern = new RegExp("^[\\+\\-]?" + digits + "+$", "i");
      return function (s) {
        /* jshint bitwise: false */
        if (pattern.test(s)) {
          var i = parseInt(s, radix);
          return (i | 0) === i ? just(i) : nothing;
        } else {
          return nothing;
        }
      };
    };
  };
};

exports.toStringAs = function (radix) {
  return function (i) {
    return i.toString(radix);
  };
};

exports.quot = function (x) {
  return function (y) {
    /* jshint bitwise: false */
    return x / y | 0;
  };
};

exports.rem = function (x) {
  return function (y) {
    return x % y;
  };
};

exports.pow = function (x) {
  return function (y) {
    /* jshint bitwise: false */
    return Math.pow(x, y) | 0;
  };
};
},{}],"../output/Data.DivisionRing/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Ring = require("../Data.Ring/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var DivisionRing = function DivisionRing(Ring0, recip) {
  this.Ring0 = Ring0;
  this.recip = recip;
};

var recip = function recip(dict) {
  return dict.recip;
};

var rightDiv = function rightDiv(dictDivisionRing) {
  return function (a) {
    return function (b) {
      return Data_Semiring.mul(dictDivisionRing.Ring0().Semiring0())(a)(recip(dictDivisionRing)(b));
    };
  };
};

var leftDiv = function leftDiv(dictDivisionRing) {
  return function (a) {
    return function (b) {
      return Data_Semiring.mul(dictDivisionRing.Ring0().Semiring0())(recip(dictDivisionRing)(b))(a);
    };
  };
};

var divisionringNumber = new DivisionRing(function () {
  return Data_Ring.ringNumber;
}, function (x) {
  return 1.0 / x;
});
module.exports = {
  DivisionRing: DivisionRing,
  recip: recip,
  leftDiv: leftDiv,
  rightDiv: rightDiv,
  divisionringNumber: divisionringNumber
};
},{"../Data.Ring/index.js":"../output/Data.Ring/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js"}],"../output/Global/foreign.js":[function(require,module,exports) {
/* globals exports */
"use strict";

exports.nan = NaN;
exports.isNaN = isNaN;
exports.infinity = Infinity;
exports.isFinite = isFinite;

exports.readInt = function (radix) {
  return function (n) {
    return parseInt(n, radix);
  };
};

exports.readFloat = parseFloat;

var formatNumber = function formatNumber(format) {
  return function (fail, succ, digits, n) {
    try {
      return succ(n[format](digits));
    } catch (e) {
      return fail(e.message);
    }
  };
};

exports._toFixed = formatNumber("toFixed");
exports._toExponential = formatNumber("toExponential");
exports._toPrecision = formatNumber("toPrecision");

var encdecURI = function encdecURI(encdec) {
  return function (fail, succ, s) {
    try {
      return succ(encdec(s));
    } catch (e) {
      return fail(e.message);
    }
  };
};

exports._decodeURI = encdecURI(decodeURI);
exports._encodeURI = encdecURI(encodeURI);
exports._decodeURIComponent = encdecURI(decodeURIComponent);
exports._encodeURIComponent = encdecURI(encodeURIComponent);
},{}],"../output/Global/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var toPrecision = function toPrecision(digits) {
  return function (n) {
    return $foreign["_toPrecision"](Data_Function["const"](Data_Maybe.Nothing.value), Data_Maybe.Just.create, digits, n);
  };
};

var toFixed = function toFixed(digits) {
  return function (n) {
    return $foreign["_toFixed"](Data_Function["const"](Data_Maybe.Nothing.value), Data_Maybe.Just.create, digits, n);
  };
};

var toExponential = function toExponential(digits) {
  return function (n) {
    return $foreign["_toExponential"](Data_Function["const"](Data_Maybe.Nothing.value), Data_Maybe.Just.create, digits, n);
  };
};

var $$encodeURIComponent = function $$encodeURIComponent(s) {
  return $foreign["_encodeURIComponent"](Data_Function["const"](Data_Maybe.Nothing.value), Data_Maybe.Just.create, s);
};

var $$encodeURI = function $$encodeURI(s) {
  return $foreign["_encodeURI"](Data_Function["const"](Data_Maybe.Nothing.value), Data_Maybe.Just.create, s);
};

var $$decodeURIComponent = function $$decodeURIComponent(s) {
  return $foreign["_decodeURIComponent"](Data_Function["const"](Data_Maybe.Nothing.value), Data_Maybe.Just.create, s);
};

var $$decodeURI = function $$decodeURI(s) {
  return $foreign["_decodeURI"](Data_Function["const"](Data_Maybe.Nothing.value), Data_Maybe.Just.create, s);
};

module.exports = {
  toFixed: toFixed,
  toExponential: toExponential,
  toPrecision: toPrecision,
  "decodeURI": $$decodeURI,
  "encodeURI": $$encodeURI,
  "decodeURIComponent": $$decodeURIComponent,
  "encodeURIComponent": $$encodeURIComponent,
  nan: $foreign.nan,
  "isNaN": $foreign["isNaN"],
  infinity: $foreign.infinity,
  "isFinite": $foreign["isFinite"],
  readInt: $foreign.readInt,
  readFloat: $foreign.readFloat
};
},{"./foreign.js":"../output/Global/foreign.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js"}],"../output/Math/foreign.js":[function(require,module,exports) {
"use strict"; // module Math

exports.abs = Math.abs;
exports.acos = Math.acos;
exports.asin = Math.asin;
exports.atan = Math.atan;

exports.atan2 = function (y) {
  return function (x) {
    return Math.atan2(y, x);
  };
};

exports.ceil = Math.ceil;
exports.cos = Math.cos;
exports.exp = Math.exp;
exports.floor = Math.floor;

exports.trunc = Math.trunc || function (n) {
  return n < 0 ? Math.ceil(n) : Math.floor(n);
};

exports.log = Math.log;

exports.max = function (n1) {
  return function (n2) {
    return Math.max(n1, n2);
  };
};

exports.min = function (n1) {
  return function (n2) {
    return Math.min(n1, n2);
  };
};

exports.pow = function (n) {
  return function (p) {
    return Math.pow(n, p);
  };
};

exports.remainder = function (n) {
  return function (m) {
    return n % m;
  };
};

exports.round = Math.round;
exports.sin = Math.sin;
exports.sqrt = Math.sqrt;
exports.tan = Math.tan;
exports.e = Math.E;
exports.ln2 = Math.LN2;
exports.ln10 = Math.LN10;
exports.log2e = Math.LOG2E;
exports.log10e = Math.LOG10E;
exports.pi = Math.PI;
exports.tau = 2 * Math.PI;
exports.sqrt1_2 = Math.SQRT1_2;
exports.sqrt2 = Math.SQRT2;
},{}],"../output/Math/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

module.exports = {
  abs: $foreign.abs,
  acos: $foreign.acos,
  asin: $foreign.asin,
  atan: $foreign.atan,
  atan2: $foreign.atan2,
  ceil: $foreign.ceil,
  cos: $foreign.cos,
  exp: $foreign.exp,
  floor: $foreign.floor,
  log: $foreign.log,
  max: $foreign.max,
  min: $foreign.min,
  pow: $foreign.pow,
  round: $foreign.round,
  sin: $foreign.sin,
  sqrt: $foreign.sqrt,
  tan: $foreign.tan,
  trunc: $foreign.trunc,
  remainder: $foreign.remainder,
  e: $foreign.e,
  ln2: $foreign.ln2,
  ln10: $foreign.ln10,
  log2e: $foreign.log2e,
  log10e: $foreign.log10e,
  pi: $foreign.pi,
  tau: $foreign.tau,
  sqrt1_2: $foreign.sqrt1_2,
  sqrt2: $foreign.sqrt2
};
},{"./foreign.js":"../output/Math/foreign.js"}],"../output/Data.Int/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_CommutativeRing = require("../Data.CommutativeRing/index.js");

var Data_DivisionRing = require("../Data.DivisionRing/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_EuclideanRing = require("../Data.EuclideanRing/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Ring = require("../Data.Ring/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Global = require("../Global/index.js");

var $$Math = require("../Math/index.js");

var Radix = function Radix(x) {
  return x;
};

var Even = function () {
  function Even() {}

  ;
  Even.value = new Even();
  return Even;
}();

var Odd = function () {
  function Odd() {}

  ;
  Odd.value = new Odd();
  return Odd;
}();

var showParity = new Data_Show.Show(function (v) {
  if (v instanceof Even) {
    return "Even";
  }

  ;

  if (v instanceof Odd) {
    return "Odd";
  }

  ;
  throw new Error("Failed pattern match at Data.Int (line 112, column 1 - line 114, column 19): " + [v.constructor.name]);
});

var radix = function radix(n) {
  if (n >= 2 && n <= 36) {
    return new Data_Maybe.Just(n);
  }

  ;

  if (Data_Boolean.otherwise) {
    return Data_Maybe.Nothing.value;
  }

  ;
  throw new Error("Failed pattern match at Data.Int (line 193, column 1 - line 193, column 28): " + [n.constructor.name]);
};

var odd = function odd(x) {
  return (x & 1) !== 0;
};

var octal = 8;
var hexadecimal = 16;
var fromStringAs = $foreign.fromStringAsImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
var fromString = fromStringAs(10);
var fromNumber = $foreign.fromNumberImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var unsafeClamp = function unsafeClamp(x) {
  if (x === Global.infinity) {
    return 0;
  }

  ;

  if (x === -Global.infinity) {
    return 0;
  }

  ;

  if (x >= $foreign.toNumber(Data_Bounded.top(Data_Bounded.boundedInt))) {
    return Data_Bounded.top(Data_Bounded.boundedInt);
  }

  ;

  if (x <= $foreign.toNumber(Data_Bounded.bottom(Data_Bounded.boundedInt))) {
    return Data_Bounded.bottom(Data_Bounded.boundedInt);
  }

  ;

  if (Data_Boolean.otherwise) {
    return Data_Maybe.fromMaybe(0)(fromNumber(x));
  }

  ;
  throw new Error("Failed pattern match at Data.Int (line 66, column 1 - line 66, column 29): " + [x.constructor.name]);
};

var round = function round($23) {
  return unsafeClamp($$Math.round($23));
};

var floor = function floor($24) {
  return unsafeClamp($$Math.floor($24));
};

var even = function even(x) {
  return (x & 1) === 0;
};

var parity = function parity(n) {
  var $14 = even(n);

  if ($14) {
    return Even.value;
  }

  ;
  return Odd.value;
};

var eqParity = new Data_Eq.Eq(function (x) {
  return function (y) {
    if (x instanceof Even && y instanceof Even) {
      return true;
    }

    ;

    if (x instanceof Odd && y instanceof Odd) {
      return true;
    }

    ;
    return false;
  };
});
var ordParity = new Data_Ord.Ord(function () {
  return eqParity;
}, function (x) {
  return function (y) {
    if (x instanceof Even && y instanceof Even) {
      return Data_Ordering.EQ.value;
    }

    ;

    if (x instanceof Even) {
      return Data_Ordering.LT.value;
    }

    ;

    if (y instanceof Even) {
      return Data_Ordering.GT.value;
    }

    ;

    if (x instanceof Odd && y instanceof Odd) {
      return Data_Ordering.EQ.value;
    }

    ;
    throw new Error("Failed pattern match at Data.Int (line 110, column 1 - line 110, column 40): " + [x.constructor.name, y.constructor.name]);
  };
});
var semiringParity = new Data_Semiring.Semiring(function (x) {
  return function (y) {
    var $19 = Data_Eq.eq(eqParity)(x)(y);

    if ($19) {
      return Even.value;
    }

    ;
    return Odd.value;
  };
}, function (v) {
  return function (v1) {
    if (v instanceof Odd && v1 instanceof Odd) {
      return Odd.value;
    }

    ;
    return Even.value;
  };
}, Odd.value, Even.value);
var ringParity = new Data_Ring.Ring(function () {
  return semiringParity;
}, Data_Semiring.add(semiringParity));
var divisionRingParity = new Data_DivisionRing.DivisionRing(function () {
  return ringParity;
}, Control_Category.identity(Control_Category.categoryFn));
var decimal = 10;
var commutativeRingParity = new Data_CommutativeRing.CommutativeRing(function () {
  return ringParity;
});
var euclideanRingParity = new Data_EuclideanRing.EuclideanRing(function () {
  return commutativeRingParity;
}, function (v) {
  if (v instanceof Even) {
    return 0;
  }

  ;

  if (v instanceof Odd) {
    return 1;
  }

  ;
  throw new Error("Failed pattern match at Data.Int (line 132, column 1 - line 136, column 17): " + [v.constructor.name]);
}, function (x) {
  return function (v) {
    return x;
  };
}, function (v) {
  return function (v1) {
    return Even.value;
  };
});

var ceil = function ceil($25) {
  return unsafeClamp($$Math.ceil($25));
};

var boundedParity = new Data_Bounded.Bounded(function () {
  return ordParity;
}, Even.value, Odd.value);
var binary = 2;
var base36 = 36;
module.exports = {
  fromNumber: fromNumber,
  ceil: ceil,
  floor: floor,
  round: round,
  fromString: fromString,
  radix: radix,
  binary: binary,
  octal: octal,
  decimal: decimal,
  hexadecimal: hexadecimal,
  base36: base36,
  fromStringAs: fromStringAs,
  Even: Even,
  Odd: Odd,
  parity: parity,
  even: even,
  odd: odd,
  eqParity: eqParity,
  ordParity: ordParity,
  showParity: showParity,
  boundedParity: boundedParity,
  semiringParity: semiringParity,
  ringParity: ringParity,
  commutativeRingParity: commutativeRingParity,
  euclideanRingParity: euclideanRingParity,
  divisionRingParity: divisionRingParity,
  toNumber: $foreign.toNumber,
  toStringAs: $foreign.toStringAs,
  quot: $foreign.quot,
  rem: $foreign.rem,
  pow: $foreign.pow
};
},{"./foreign.js":"../output/Data.Int/foreign.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.CommutativeRing/index.js":"../output/Data.CommutativeRing/index.js","../Data.DivisionRing/index.js":"../output/Data.DivisionRing/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.EuclideanRing/index.js":"../output/Data.EuclideanRing/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Ring/index.js":"../output/Data.Ring/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Global/index.js":"../output/Global/index.js","../Math/index.js":"../output/Math/index.js"}],"../output/Data.List/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Lazy = require("../Control.Lazy/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_NonEmpty = require("../Data.NonEmpty/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Pattern = function Pattern(x) {
  return x;
};

var updateAt = function updateAt(v) {
  return function (v1) {
    return function (v2) {
      if (v === 0 && v2 instanceof Data_List_Types.Cons) {
        return new Data_Maybe.Just(new Data_List_Types.Cons(v1, v2.value1));
      }

      ;

      if (v2 instanceof Data_List_Types.Cons) {
        return Data_Functor.map(Data_Maybe.functorMaybe)(function (v3) {
          return new Data_List_Types.Cons(v2.value0, v3);
        })(updateAt(v - 1 | 0)(v1)(v2.value1));
      }

      ;
      return Data_Maybe.Nothing.value;
    };
  };
};

var unzip = Data_Foldable.foldr(Data_List_Types.foldableList)(function (v) {
  return function (v1) {
    return new Data_Tuple.Tuple(new Data_List_Types.Cons(v.value0, v1.value0), new Data_List_Types.Cons(v.value1, v1.value1));
  };
})(new Data_Tuple.Tuple(Data_List_Types.Nil.value, Data_List_Types.Nil.value));

var uncons = function uncons(v) {
  if (v instanceof Data_List_Types.Nil) {
    return Data_Maybe.Nothing.value;
  }

  ;

  if (v instanceof Data_List_Types.Cons) {
    return new Data_Maybe.Just({
      head: v.value0,
      tail: v.value1
    });
  }

  ;
  throw new Error("Failed pattern match at Data.List (line 259, column 1 - line 259, column 66): " + [v.constructor.name]);
};

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  return Data_Unfoldable.unfoldr(dictUnfoldable)(function (xs) {
    return Data_Functor.map(Data_Maybe.functorMaybe)(function (rec) {
      return new Data_Tuple.Tuple(rec.head, rec.tail);
    })(uncons(xs));
  });
};

var tail = function tail(v) {
  if (v instanceof Data_List_Types.Nil) {
    return Data_Maybe.Nothing.value;
  }

  ;

  if (v instanceof Data_List_Types.Cons) {
    return new Data_Maybe.Just(v.value1);
  }

  ;
  throw new Error("Failed pattern match at Data.List (line 245, column 1 - line 245, column 43): " + [v.constructor.name]);
};

var stripPrefix = function stripPrefix(dictEq) {
  return function (v) {
    return function (s) {
      var go = function go(prefix) {
        return function (input) {
          if (prefix instanceof Data_List_Types.Cons && input instanceof Data_List_Types.Cons && Data_Eq.eq(dictEq)(prefix.value0)(input.value0)) {
            return Data_Maybe.Just.create(new Control_Monad_Rec_Class.Loop({
              a: prefix.value1,
              b: input.value1
            }));
          }

          ;

          if (prefix instanceof Data_List_Types.Nil) {
            return Data_Maybe.Just.create(new Control_Monad_Rec_Class.Done(input));
          }

          ;
          return Data_Maybe.Nothing.value;
        };
      };

      return Control_Monad_Rec_Class.tailRecM2(Control_Monad_Rec_Class.monadRecMaybe)(go)(v)(s);
    };
  };
};

var span = function span(v) {
  return function (v1) {
    if (v1 instanceof Data_List_Types.Cons && v(v1.value0)) {
      var v2 = span(v)(v1.value1);
      return {
        init: new Data_List_Types.Cons(v1.value0, v2.init),
        rest: v2.rest
      };
    }

    ;
    return {
      init: Data_List_Types.Nil.value,
      rest: v1
    };
  };
};

var snoc = function snoc(xs) {
  return function (x) {
    return Data_Foldable.foldr(Data_List_Types.foldableList)(Data_List_Types.Cons.create)(new Data_List_Types.Cons(x, Data_List_Types.Nil.value))(xs);
  };
};

var singleton = function singleton(a) {
  return new Data_List_Types.Cons(a, Data_List_Types.Nil.value);
};

var sortBy = function sortBy(cmp) {
  var merge = function merge(v) {
    return function (v1) {
      if (v instanceof Data_List_Types.Cons && v1 instanceof Data_List_Types.Cons) {
        if (Data_Eq.eq(Data_Ordering.eqOrdering)(cmp(v.value0)(v1.value0))(Data_Ordering.GT.value)) {
          return new Data_List_Types.Cons(v1.value0, merge(v)(v1.value1));
        }

        ;

        if (Data_Boolean.otherwise) {
          return new Data_List_Types.Cons(v.value0, merge(v.value1)(v1));
        }

        ;
      }

      ;

      if (v instanceof Data_List_Types.Nil) {
        return v1;
      }

      ;

      if (v1 instanceof Data_List_Types.Nil) {
        return v;
      }

      ;
      throw new Error("Failed pattern match at Data.List (line 473, column 3 - line 473, column 38): " + [v.constructor.name, v1.constructor.name]);
    };
  };

  var mergePairs = function mergePairs(v) {
    if (v instanceof Data_List_Types.Cons && v.value1 instanceof Data_List_Types.Cons) {
      return new Data_List_Types.Cons(merge(v.value0)(v.value1.value0), mergePairs(v.value1.value1));
    }

    ;
    return v;
  };

  var mergeAll = function mergeAll($copy_v) {
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v) {
      if (v instanceof Data_List_Types.Cons && v.value1 instanceof Data_List_Types.Nil) {
        $tco_done = true;
        return v.value0;
      }

      ;
      $copy_v = mergePairs(v);
      return;
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  var sequences = function sequences(v) {
    if (v instanceof Data_List_Types.Cons && v.value1 instanceof Data_List_Types.Cons) {
      if (Data_Eq.eq(Data_Ordering.eqOrdering)(cmp(v.value0)(v.value1.value0))(Data_Ordering.GT.value)) {
        return descending(v.value1.value0)(singleton(v.value0))(v.value1.value1);
      }

      ;

      if (Data_Boolean.otherwise) {
        return ascending(v.value1.value0)(function (v1) {
          return new Data_List_Types.Cons(v.value0, v1);
        })(v.value1.value1);
      }

      ;
    }

    ;
    return singleton(v);
  };

  var descending = function descending($copy_a) {
    return function ($copy_as) {
      return function ($copy_v) {
        var $tco_var_a = $copy_a;
        var $tco_var_as = $copy_as;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(a, as, v) {
          if (v instanceof Data_List_Types.Cons && Data_Eq.eq(Data_Ordering.eqOrdering)(cmp(a)(v.value0))(Data_Ordering.GT.value)) {
            $tco_var_a = v.value0;
            $tco_var_as = new Data_List_Types.Cons(a, as);
            $copy_v = v.value1;
            return;
          }

          ;
          $tco_done = true;
          return new Data_List_Types.Cons(new Data_List_Types.Cons(a, as), sequences(v));
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_a, $tco_var_as, $copy_v);
        }

        ;
        return $tco_result;
      };
    };
  };

  var ascending = function ascending($copy_a) {
    return function ($copy_as) {
      return function ($copy_v) {
        var $tco_var_a = $copy_a;
        var $tco_var_as = $copy_as;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(a, as, v) {
          if (v instanceof Data_List_Types.Cons && Data_Eq.notEq(Data_Ordering.eqOrdering)(cmp(a)(v.value0))(Data_Ordering.GT.value)) {
            $tco_var_a = v.value0;

            $tco_var_as = function $tco_var_as(ys) {
              return as(new Data_List_Types.Cons(a, ys));
            };

            $copy_v = v.value1;
            return;
          }

          ;
          $tco_done = true;
          return new Data_List_Types.Cons(as(singleton(a)), sequences(v));
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_a, $tco_var_as, $copy_v);
        }

        ;
        return $tco_result;
      };
    };
  };

  return function ($331) {
    return mergeAll(sequences($331));
  };
};

var sort = function sort(dictOrd) {
  return function (xs) {
    return sortBy(Data_Ord.compare(dictOrd))(xs);
  };
};

var tails = function tails(v) {
  if (v instanceof Data_List_Types.Nil) {
    return singleton(Data_List_Types.Nil.value);
  }

  ;

  if (v instanceof Data_List_Types.Cons) {
    return new Data_List_Types.Cons(v, tails(v.value1));
  }

  ;
  throw new Error("Failed pattern match at Data.List (line 626, column 1 - line 626, column 43): " + [v.constructor.name]);
};

var showPattern = function showPattern(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Pattern " + (Data_Show.show(Data_List_Types.showList(dictShow))(v) + ")");
  });
};

var reverse = function () {
  var go = function go($copy_acc) {
    return function ($copy_v) {
      var $tco_var_acc = $copy_acc;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(acc, v) {
        if (v instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return acc;
        }

        ;

        if (v instanceof Data_List_Types.Cons) {
          $tco_var_acc = new Data_List_Types.Cons(v.value0, acc);
          $copy_v = v.value1;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.List (line 368, column 3 - line 368, column 19): " + [acc.constructor.name, v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_acc, $copy_v);
      }

      ;
      return $tco_result;
    };
  };

  return go(Data_List_Types.Nil.value);
}();

var take = function () {
  var go = function go($copy_acc) {
    return function ($copy_v) {
      return function ($copy_v1) {
        var $tco_var_acc = $copy_acc;
        var $tco_var_v = $copy_v;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(acc, v, v1) {
          if (v < 1) {
            $tco_done = true;
            return reverse(acc);
          }

          ;

          if (v1 instanceof Data_List_Types.Nil) {
            $tco_done = true;
            return reverse(acc);
          }

          ;

          if (v1 instanceof Data_List_Types.Cons) {
            $tco_var_acc = new Data_List_Types.Cons(v1.value0, acc);
            $tco_var_v = v - 1 | 0;
            $copy_v1 = v1.value1;
            return;
          }

          ;
          throw new Error("Failed pattern match at Data.List (line 520, column 3 - line 520, column 35): " + [acc.constructor.name, v.constructor.name, v1.constructor.name]);
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_acc, $tco_var_v, $copy_v1);
        }

        ;
        return $tco_result;
      };
    };
  };

  return go(Data_List_Types.Nil.value);
}();

var takeWhile = function takeWhile(p) {
  var go = function go($copy_acc) {
    return function ($copy_v) {
      var $tco_var_acc = $copy_acc;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(acc, v) {
        if (v instanceof Data_List_Types.Cons && p(v.value0)) {
          $tco_var_acc = new Data_List_Types.Cons(v.value0, acc);
          $copy_v = v.value1;
          return;
        }

        ;
        $tco_done = true;
        return reverse(acc);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_acc, $copy_v);
      }

      ;
      return $tco_result;
    };
  };

  return go(Data_List_Types.Nil.value);
};

var unsnoc = function unsnoc(lst) {
  var go = function go($copy_v) {
    return function ($copy_acc) {
      var $tco_var_v = $copy_v;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v, acc) {
        if (v instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return Data_Maybe.Nothing.value;
        }

        ;

        if (v instanceof Data_List_Types.Cons && v.value1 instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return new Data_Maybe.Just({
            revInit: acc,
            last: v.value0
          });
        }

        ;

        if (v instanceof Data_List_Types.Cons) {
          $tco_var_v = v.value1;
          $copy_acc = new Data_List_Types.Cons(v.value0, acc);
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.List (line 270, column 3 - line 270, column 23): " + [v.constructor.name, acc.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_v, $copy_acc);
      }

      ;
      return $tco_result;
    };
  };

  return Data_Functor.map(Data_Maybe.functorMaybe)(function (h) {
    return {
      init: reverse(h.revInit),
      last: h.last
    };
  })(go(lst)(Data_List_Types.Nil.value));
};

var zipWith = function zipWith(f) {
  return function (xs) {
    return function (ys) {
      var go = function go($copy_v) {
        return function ($copy_v1) {
          return function ($copy_acc) {
            var $tco_var_v = $copy_v;
            var $tco_var_v1 = $copy_v1;
            var $tco_done = false;
            var $tco_result;

            function $tco_loop(v, v1, acc) {
              if (v instanceof Data_List_Types.Nil) {
                $tco_done = true;
                return acc;
              }

              ;

              if (v1 instanceof Data_List_Types.Nil) {
                $tco_done = true;
                return acc;
              }

              ;

              if (v instanceof Data_List_Types.Cons && v1 instanceof Data_List_Types.Cons) {
                $tco_var_v = v.value1;
                $tco_var_v1 = v1.value1;
                $copy_acc = new Data_List_Types.Cons(f(v.value0)(v1.value0), acc);
                return;
              }

              ;
              throw new Error("Failed pattern match at Data.List (line 718, column 3 - line 718, column 21): " + [v.constructor.name, v1.constructor.name, acc.constructor.name]);
            }

            ;

            while (!$tco_done) {
              $tco_result = $tco_loop($tco_var_v, $tco_var_v1, $copy_acc);
            }

            ;
            return $tco_result;
          };
        };
      };

      return reverse(go(xs)(ys)(Data_List_Types.Nil.value));
    };
  };
};

var zip = zipWith(Data_Tuple.Tuple.create);

var zipWithA = function zipWithA(dictApplicative) {
  return function (f) {
    return function (xs) {
      return function (ys) {
        return Data_Traversable.sequence(Data_List_Types.traversableList)(dictApplicative)(zipWith(f)(xs)(ys));
      };
    };
  };
};

var range = function range(start) {
  return function (end) {
    if (start === end) {
      return singleton(start);
    }

    ;

    if (Data_Boolean.otherwise) {
      var go = function go($copy_s) {
        return function ($copy_e) {
          return function ($copy_step) {
            return function ($copy_rest) {
              var $tco_var_s = $copy_s;
              var $tco_var_e = $copy_e;
              var $tco_var_step = $copy_step;
              var $tco_done = false;
              var $tco_result;

              function $tco_loop(s, e, step, rest) {
                if (s === e) {
                  $tco_done = true;
                  return new Data_List_Types.Cons(s, rest);
                }

                ;

                if (Data_Boolean.otherwise) {
                  $tco_var_s = s + step | 0;
                  $tco_var_e = e;
                  $tco_var_step = step;
                  $copy_rest = new Data_List_Types.Cons(s, rest);
                  return;
                }

                ;
                throw new Error("Failed pattern match at Data.List (line 148, column 3 - line 149, column 65): " + [s.constructor.name, e.constructor.name, step.constructor.name, rest.constructor.name]);
              }

              ;

              while (!$tco_done) {
                $tco_result = $tco_loop($tco_var_s, $tco_var_e, $tco_var_step, $copy_rest);
              }

              ;
              return $tco_result;
            };
          };
        };
      };

      return go(end)(start)(function () {
        var $220 = start > end;

        if ($220) {
          return 1;
        }

        ;
        return -1 | 0;
      }())(Data_List_Types.Nil.value);
    }

    ;
    throw new Error("Failed pattern match at Data.List (line 144, column 1 - line 144, column 32): " + [start.constructor.name, end.constructor.name]);
  };
};

var partition = function partition(p) {
  return function (xs) {
    var select = function select(x) {
      return function (v) {
        var $223 = p(x);

        if ($223) {
          return {
            no: v.no,
            yes: new Data_List_Types.Cons(x, v.yes)
          };
        }

        ;
        return {
          no: new Data_List_Types.Cons(x, v.no),
          yes: v.yes
        };
      };
    };

    return Data_Foldable.foldr(Data_List_Types.foldableList)(select)({
      no: Data_List_Types.Nil.value,
      yes: Data_List_Types.Nil.value
    })(xs);
  };
};

var $$null = function $$null(v) {
  if (v instanceof Data_List_Types.Nil) {
    return true;
  }

  ;
  return false;
};

var newtypePattern = new Data_Newtype.Newtype(function (n) {
  return n;
}, Pattern);
var mapWithIndex = Data_FunctorWithIndex.mapWithIndex(Data_List_Types.functorWithIndexList);

var mapMaybe = function mapMaybe(f) {
  var go = function go($copy_acc) {
    return function ($copy_v) {
      var $tco_var_acc = $copy_acc;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(acc, v) {
        if (v instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return reverse(acc);
        }

        ;

        if (v instanceof Data_List_Types.Cons) {
          var v1 = f(v.value0);

          if (v1 instanceof Data_Maybe.Nothing) {
            $tco_var_acc = acc;
            $copy_v = v.value1;
            return;
          }

          ;

          if (v1 instanceof Data_Maybe.Just) {
            $tco_var_acc = new Data_List_Types.Cons(v1.value0, acc);
            $copy_v = v.value1;
            return;
          }

          ;
          throw new Error("Failed pattern match at Data.List (line 419, column 5 - line 421, column 32): " + [v1.constructor.name]);
        }

        ;
        throw new Error("Failed pattern match at Data.List (line 417, column 3 - line 417, column 27): " + [acc.constructor.name, v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_acc, $copy_v);
      }

      ;
      return $tco_result;
    };
  };

  return go(Data_List_Types.Nil.value);
};

var manyRec = function manyRec(dictMonadRec) {
  return function (dictAlternative) {
    return function (p) {
      var go = function go(acc) {
        return Control_Bind.bind(dictMonadRec.Monad0().Bind1())(Control_Alt.alt(dictAlternative.Plus1().Alt0())(Data_Functor.map(dictAlternative.Plus1().Alt0().Functor0())(Control_Monad_Rec_Class.Loop.create)(p))(Control_Applicative.pure(dictAlternative.Applicative0())(new Control_Monad_Rec_Class.Done(Data_Unit.unit))))(function (aa) {
          return Control_Applicative.pure(dictAlternative.Applicative0())(Data_Bifunctor.bimap(Control_Monad_Rec_Class.bifunctorStep)(function (v) {
            return new Data_List_Types.Cons(v, acc);
          })(function (v) {
            return reverse(acc);
          })(aa));
        });
      };

      return Control_Monad_Rec_Class.tailRecM(dictMonadRec)(go)(Data_List_Types.Nil.value);
    };
  };
};

var someRec = function someRec(dictMonadRec) {
  return function (dictAlternative) {
    return function (v) {
      return Control_Apply.apply(dictAlternative.Applicative0().Apply0())(Data_Functor.map(dictAlternative.Plus1().Alt0().Functor0())(Data_List_Types.Cons.create)(v))(manyRec(dictMonadRec)(dictAlternative)(v));
    };
  };
};

var some = function some(dictAlternative) {
  return function (dictLazy) {
    return function (v) {
      return Control_Apply.apply(dictAlternative.Applicative0().Apply0())(Data_Functor.map(dictAlternative.Plus1().Alt0().Functor0())(Data_List_Types.Cons.create)(v))(Control_Lazy.defer(dictLazy)(function (v1) {
        return many(dictAlternative)(dictLazy)(v);
      }));
    };
  };
};

var many = function many(dictAlternative) {
  return function (dictLazy) {
    return function (v) {
      return Control_Alt.alt(dictAlternative.Plus1().Alt0())(some(dictAlternative)(dictLazy)(v))(Control_Applicative.pure(dictAlternative.Applicative0())(Data_List_Types.Nil.value));
    };
  };
};

var length = Data_Foldable.foldl(Data_List_Types.foldableList)(function (acc) {
  return function (v) {
    return acc + 1 | 0;
  };
})(0);

var last = function last($copy_v) {
  var $tco_done = false;
  var $tco_result;

  function $tco_loop(v) {
    if (v instanceof Data_List_Types.Cons && v.value1 instanceof Data_List_Types.Nil) {
      $tco_done = true;
      return new Data_Maybe.Just(v.value0);
    }

    ;

    if (v instanceof Data_List_Types.Cons) {
      $copy_v = v.value1;
      return;
    }

    ;
    $tco_done = true;
    return Data_Maybe.Nothing.value;
  }

  ;

  while (!$tco_done) {
    $tco_result = $tco_loop($copy_v);
  }

  ;
  return $tco_result;
};

var insertBy = function insertBy(v) {
  return function (x) {
    return function (v1) {
      if (v1 instanceof Data_List_Types.Nil) {
        return singleton(x);
      }

      ;

      if (v1 instanceof Data_List_Types.Cons) {
        var v2 = v(x)(v1.value0);

        if (v2 instanceof Data_Ordering.GT) {
          return new Data_List_Types.Cons(v1.value0, insertBy(v)(x)(v1.value1));
        }

        ;
        return new Data_List_Types.Cons(x, v1);
      }

      ;
      throw new Error("Failed pattern match at Data.List (line 216, column 1 - line 216, column 68): " + [v.constructor.name, x.constructor.name, v1.constructor.name]);
    };
  };
};

var insertAt = function insertAt(v) {
  return function (v1) {
    return function (v2) {
      if (v === 0) {
        return new Data_Maybe.Just(new Data_List_Types.Cons(v1, v2));
      }

      ;

      if (v2 instanceof Data_List_Types.Cons) {
        return Data_Functor.map(Data_Maybe.functorMaybe)(function (v3) {
          return new Data_List_Types.Cons(v2.value0, v3);
        })(insertAt(v - 1 | 0)(v1)(v2.value1));
      }

      ;
      return Data_Maybe.Nothing.value;
    };
  };
};

var insert = function insert(dictOrd) {
  return insertBy(Data_Ord.compare(dictOrd));
};

var init = function init(lst) {
  return Data_Functor.map(Data_Maybe.functorMaybe)(function (v) {
    return v.init;
  })(unsnoc(lst));
};

var index = function index($copy_v) {
  return function ($copy_v1) {
    var $tco_var_v = $copy_v;
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v, v1) {
      if (v instanceof Data_List_Types.Nil) {
        $tco_done = true;
        return Data_Maybe.Nothing.value;
      }

      ;

      if (v instanceof Data_List_Types.Cons && v1 === 0) {
        $tco_done = true;
        return new Data_Maybe.Just(v.value0);
      }

      ;

      if (v instanceof Data_List_Types.Cons) {
        $tco_var_v = v.value1;
        $copy_v1 = v1 - 1 | 0;
        return;
      }

      ;
      throw new Error("Failed pattern match at Data.List (line 281, column 1 - line 281, column 44): " + [v.constructor.name, v1.constructor.name]);
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($tco_var_v, $copy_v1);
    }

    ;
    return $tco_result;
  };
};

var head = function head(v) {
  if (v instanceof Data_List_Types.Nil) {
    return Data_Maybe.Nothing.value;
  }

  ;

  if (v instanceof Data_List_Types.Cons) {
    return new Data_Maybe.Just(v.value0);
  }

  ;
  throw new Error("Failed pattern match at Data.List (line 230, column 1 - line 230, column 22): " + [v.constructor.name]);
};

var transpose = function transpose(v) {
  if (v instanceof Data_List_Types.Nil) {
    return Data_List_Types.Nil.value;
  }

  ;

  if (v instanceof Data_List_Types.Cons && v.value0 instanceof Data_List_Types.Nil) {
    return transpose(v.value1);
  }

  ;

  if (v instanceof Data_List_Types.Cons && v.value0 instanceof Data_List_Types.Cons) {
    return new Data_List_Types.Cons(new Data_List_Types.Cons(v.value0.value0, mapMaybe(head)(v.value1)), transpose(new Data_List_Types.Cons(v.value0.value1, mapMaybe(tail)(v.value1))));
  }

  ;
  throw new Error("Failed pattern match at Data.List (line 752, column 1 - line 752, column 54): " + [v.constructor.name]);
};

var groupBy = function groupBy(v) {
  return function (v1) {
    if (v1 instanceof Data_List_Types.Nil) {
      return Data_List_Types.Nil.value;
    }

    ;

    if (v1 instanceof Data_List_Types.Cons) {
      var v2 = span(v(v1.value0))(v1.value1);
      return new Data_List_Types.Cons(new Data_NonEmpty.NonEmpty(v1.value0, v2.init), groupBy(v)(v2.rest));
    }

    ;
    throw new Error("Failed pattern match at Data.List (line 605, column 1 - line 605, column 80): " + [v.constructor.name, v1.constructor.name]);
  };
};

var group = function group(dictEq) {
  return groupBy(Data_Eq.eq(dictEq));
};

var group$prime = function group$prime(dictOrd) {
  var $332 = group(dictOrd.Eq0());
  var $333 = sort(dictOrd);
  return function ($334) {
    return $332($333($334));
  };
};

var fromFoldable = function fromFoldable(dictFoldable) {
  return Data_Foldable.foldr(dictFoldable)(Data_List_Types.Cons.create)(Data_List_Types.Nil.value);
};

var foldM = function foldM(dictMonad) {
  return function (v) {
    return function (a) {
      return function (v1) {
        if (v1 instanceof Data_List_Types.Nil) {
          return Control_Applicative.pure(dictMonad.Applicative0())(a);
        }

        ;

        if (v1 instanceof Data_List_Types.Cons) {
          return Control_Bind.bind(dictMonad.Bind1())(v(a)(v1.value0))(function (a$prime) {
            return foldM(dictMonad)(v)(a$prime)(v1.value1);
          });
        }

        ;
        throw new Error("Failed pattern match at Data.List (line 763, column 1 - line 763, column 72): " + [v.constructor.name, a.constructor.name, v1.constructor.name]);
      };
    };
  };
};

var findIndex = function findIndex(fn) {
  var go = function go($copy_v) {
    return function ($copy_v1) {
      var $tco_var_v = $copy_v;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v, v1) {
        if (v1 instanceof Data_List_Types.Cons) {
          if (fn(v1.value0)) {
            $tco_done = true;
            return new Data_Maybe.Just(v);
          }

          ;

          if (Data_Boolean.otherwise) {
            $tco_var_v = v + 1 | 0;
            $copy_v1 = v1.value1;
            return;
          }

          ;
        }

        ;

        if (v1 instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return Data_Maybe.Nothing.value;
        }

        ;
        throw new Error("Failed pattern match at Data.List (line 301, column 3 - line 301, column 35): " + [v.constructor.name, v1.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_v, $copy_v1);
      }

      ;
      return $tco_result;
    };
  };

  return go(0);
};

var findLastIndex = function findLastIndex(fn) {
  return function (xs) {
    return Data_Functor.map(Data_Maybe.functorMaybe)(function (v) {
      return (length(xs) - 1 | 0) - v | 0;
    })(findIndex(fn)(reverse(xs)));
  };
};

var filterM = function filterM(dictMonad) {
  return function (v) {
    return function (v1) {
      if (v1 instanceof Data_List_Types.Nil) {
        return Control_Applicative.pure(dictMonad.Applicative0())(Data_List_Types.Nil.value);
      }

      ;

      if (v1 instanceof Data_List_Types.Cons) {
        return Control_Bind.bind(dictMonad.Bind1())(v(v1.value0))(function (b) {
          return Control_Bind.bind(dictMonad.Bind1())(filterM(dictMonad)(v)(v1.value1))(function (xs$prime) {
            return Control_Applicative.pure(dictMonad.Applicative0())(function () {
              if (b) {
                return new Data_List_Types.Cons(v1.value0, xs$prime);
              }

              ;
              return xs$prime;
            }());
          });
        });
      }

      ;
      throw new Error("Failed pattern match at Data.List (line 403, column 1 - line 403, column 75): " + [v.constructor.name, v1.constructor.name]);
    };
  };
};

var filter = function filter(p) {
  var go = function go($copy_acc) {
    return function ($copy_v) {
      var $tco_var_acc = $copy_acc;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(acc, v) {
        if (v instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return reverse(acc);
        }

        ;

        if (v instanceof Data_List_Types.Cons) {
          if (p(v.value0)) {
            $tco_var_acc = new Data_List_Types.Cons(v.value0, acc);
            $copy_v = v.value1;
            return;
          }

          ;

          if (Data_Boolean.otherwise) {
            $tco_var_acc = acc;
            $copy_v = v.value1;
            return;
          }

          ;
        }

        ;
        throw new Error("Failed pattern match at Data.List (line 390, column 3 - line 390, column 27): " + [acc.constructor.name, v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_acc, $copy_v);
      }

      ;
      return $tco_result;
    };
  };

  return go(Data_List_Types.Nil.value);
};

var intersectBy = function intersectBy(v) {
  return function (v1) {
    return function (v2) {
      if (v1 instanceof Data_List_Types.Nil) {
        return Data_List_Types.Nil.value;
      }

      ;

      if (v2 instanceof Data_List_Types.Nil) {
        return Data_List_Types.Nil.value;
      }

      ;
      return filter(function (x) {
        return Data_Foldable.any(Data_List_Types.foldableList)(Data_HeytingAlgebra.heytingAlgebraBoolean)(v(x))(v2);
      })(v1);
    };
  };
};

var intersect = function intersect(dictEq) {
  return intersectBy(Data_Eq.eq(dictEq));
};

var nubBy = function nubBy(v) {
  return function (v1) {
    if (v1 instanceof Data_List_Types.Nil) {
      return Data_List_Types.Nil.value;
    }

    ;

    if (v1 instanceof Data_List_Types.Cons) {
      return new Data_List_Types.Cons(v1.value0, nubBy(v)(filter(function (y) {
        return !v(v1.value0)(y);
      })(v1.value1)));
    }

    ;
    throw new Error("Failed pattern match at Data.List (line 644, column 1 - line 644, column 59): " + [v.constructor.name, v1.constructor.name]);
  };
};

var nub = function nub(dictEq) {
  return nubBy(Data_Eq.eq(dictEq));
};

var eqPattern = function eqPattern(dictEq) {
  return new Data_Eq.Eq(function (x) {
    return function (y) {
      return Data_Eq.eq(Data_List_Types.eqList(dictEq))(x)(y);
    };
  });
};

var ordPattern = function ordPattern(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqPattern(dictOrd.Eq0());
  }, function (x) {
    return function (y) {
      return Data_Ord.compare(Data_List_Types.ordList(dictOrd))(x)(y);
    };
  });
};

var elemLastIndex = function elemLastIndex(dictEq) {
  return function (x) {
    return findLastIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var elemIndex = function elemIndex(dictEq) {
  return function (x) {
    return findIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var dropWhile = function dropWhile(p) {
  var go = function go($copy_v) {
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v) {
      if (v instanceof Data_List_Types.Cons && p(v.value0)) {
        $copy_v = v.value1;
        return;
      }

      ;
      $tco_done = true;
      return v;
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  return go;
};

var dropEnd = function dropEnd(n) {
  return function (xs) {
    return take(length(xs) - n | 0)(xs);
  };
};

var drop = function drop($copy_v) {
  return function ($copy_v1) {
    var $tco_var_v = $copy_v;
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v, v1) {
      if (v < 1) {
        $tco_done = true;
        return v1;
      }

      ;

      if (v1 instanceof Data_List_Types.Nil) {
        $tco_done = true;
        return Data_List_Types.Nil.value;
      }

      ;

      if (v1 instanceof Data_List_Types.Cons) {
        $tco_var_v = v - 1 | 0;
        $copy_v1 = v1.value1;
        return;
      }

      ;
      throw new Error("Failed pattern match at Data.List (line 543, column 1 - line 543, column 42): " + [v.constructor.name, v1.constructor.name]);
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($tco_var_v, $copy_v1);
    }

    ;
    return $tco_result;
  };
};

var slice = function slice(start) {
  return function (end) {
    return function (xs) {
      return take(end - start | 0)(drop(start)(xs));
    };
  };
};

var takeEnd = function takeEnd(n) {
  return function (xs) {
    return drop(length(xs) - n | 0)(xs);
  };
};

var deleteBy = function deleteBy(v) {
  return function (v1) {
    return function (v2) {
      if (v2 instanceof Data_List_Types.Nil) {
        return Data_List_Types.Nil.value;
      }

      ;

      if (v2 instanceof Data_List_Types.Cons && v(v1)(v2.value0)) {
        return v2.value1;
      }

      ;

      if (v2 instanceof Data_List_Types.Cons) {
        return new Data_List_Types.Cons(v2.value0, deleteBy(v)(v1)(v2.value1));
      }

      ;
      throw new Error("Failed pattern match at Data.List (line 671, column 1 - line 671, column 67): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
    };
  };
};

var unionBy = function unionBy(eq) {
  return function (xs) {
    return function (ys) {
      return Data_Semigroup.append(Data_List_Types.semigroupList)(xs)(Data_Foldable.foldl(Data_List_Types.foldableList)(Data_Function.flip(deleteBy(eq)))(nubBy(eq)(ys))(xs));
    };
  };
};

var union = function union(dictEq) {
  return unionBy(Data_Eq.eq(dictEq));
};

var deleteAt = function deleteAt(v) {
  return function (v1) {
    if (v === 0 && v1 instanceof Data_List_Types.Cons) {
      return new Data_Maybe.Just(v1.value1);
    }

    ;

    if (v1 instanceof Data_List_Types.Cons) {
      return Data_Functor.map(Data_Maybe.functorMaybe)(function (v2) {
        return new Data_List_Types.Cons(v1.value0, v2);
      })(deleteAt(v - 1 | 0)(v1.value1));
    }

    ;
    return Data_Maybe.Nothing.value;
  };
};

var $$delete = function $$delete(dictEq) {
  return deleteBy(Data_Eq.eq(dictEq));
};

var difference = function difference(dictEq) {
  return Data_Foldable.foldl(Data_List_Types.foldableList)(Data_Function.flip($$delete(dictEq)));
};

var concatMap = Data_Function.flip(Control_Bind.bind(Data_List_Types.bindList));

var concat = function concat(v) {
  return Control_Bind.bind(Data_List_Types.bindList)(v)(Control_Category.identity(Control_Category.categoryFn));
};

var catMaybes = mapMaybe(Control_Category.identity(Control_Category.categoryFn));

var alterAt = function alterAt(v) {
  return function (v1) {
    return function (v2) {
      if (v === 0 && v2 instanceof Data_List_Types.Cons) {
        return Data_Maybe.Just.create(function () {
          var v3 = v1(v2.value0);

          if (v3 instanceof Data_Maybe.Nothing) {
            return v2.value1;
          }

          ;

          if (v3 instanceof Data_Maybe.Just) {
            return new Data_List_Types.Cons(v3.value0, v2.value1);
          }

          ;
          throw new Error("Failed pattern match at Data.List (line 352, column 3 - line 354, column 23): " + [v3.constructor.name]);
        }());
      }

      ;

      if (v2 instanceof Data_List_Types.Cons) {
        return Data_Functor.map(Data_Maybe.functorMaybe)(function (v3) {
          return new Data_List_Types.Cons(v2.value0, v3);
        })(alterAt(v - 1 | 0)(v1)(v2.value1));
      }

      ;
      return Data_Maybe.Nothing.value;
    };
  };
};

var modifyAt = function modifyAt(n) {
  return function (f) {
    return alterAt(n)(function ($335) {
      return Data_Maybe.Just.create(f($335));
    });
  };
};

module.exports = {
  toUnfoldable: toUnfoldable,
  fromFoldable: fromFoldable,
  singleton: singleton,
  range: range,
  some: some,
  someRec: someRec,
  many: many,
  manyRec: manyRec,
  "null": $$null,
  length: length,
  snoc: snoc,
  insert: insert,
  insertBy: insertBy,
  head: head,
  last: last,
  tail: tail,
  init: init,
  uncons: uncons,
  unsnoc: unsnoc,
  index: index,
  elemIndex: elemIndex,
  elemLastIndex: elemLastIndex,
  findIndex: findIndex,
  findLastIndex: findLastIndex,
  insertAt: insertAt,
  deleteAt: deleteAt,
  updateAt: updateAt,
  modifyAt: modifyAt,
  alterAt: alterAt,
  reverse: reverse,
  concat: concat,
  concatMap: concatMap,
  filter: filter,
  filterM: filterM,
  mapMaybe: mapMaybe,
  catMaybes: catMaybes,
  mapWithIndex: mapWithIndex,
  sort: sort,
  sortBy: sortBy,
  Pattern: Pattern,
  stripPrefix: stripPrefix,
  slice: slice,
  take: take,
  takeEnd: takeEnd,
  takeWhile: takeWhile,
  drop: drop,
  dropEnd: dropEnd,
  dropWhile: dropWhile,
  span: span,
  group: group,
  "group'": group$prime,
  groupBy: groupBy,
  partition: partition,
  nub: nub,
  nubBy: nubBy,
  union: union,
  unionBy: unionBy,
  "delete": $$delete,
  deleteBy: deleteBy,
  difference: difference,
  intersect: intersect,
  intersectBy: intersectBy,
  zipWith: zipWith,
  zipWithA: zipWithA,
  zip: zip,
  unzip: unzip,
  transpose: transpose,
  foldM: foldM,
  eqPattern: eqPattern,
  ordPattern: ordPattern,
  newtypePattern: newtypePattern,
  showPattern: showPattern
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Lazy/index.js":"../output/Control.Lazy/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.NonEmpty/index.js":"../output/Data.NonEmpty/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Partial.Unsafe/foreign.js":[function(require,module,exports) {
"use strict"; // module Partial.Unsafe

exports.unsafePartial = function (f) {
  return f();
};
},{}],"../output/Partial/foreign.js":[function(require,module,exports) {
"use strict"; // module Partial

exports.crashWith = function () {
  return function (msg) {
    throw new Error(msg);
  };
};
},{}],"../output/Partial/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var crash = function crash(dictPartial) {
  return $foreign.crashWith()("Partial.crash: partial function");
};

module.exports = {
  crash: crash,
  crashWith: $foreign.crashWith
};
},{"./foreign.js":"../output/Partial/foreign.js"}],"../output/Partial.Unsafe/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Partial = require("../Partial/index.js");

var unsafePartialBecause = function unsafePartialBecause(v) {
  return function (x) {
    return $foreign.unsafePartial(function (dictPartial) {
      return x();
    });
  };
};

var unsafeCrashWith = function unsafeCrashWith(msg) {
  return $foreign.unsafePartial(function (dictPartial) {
    return Partial.crashWith()(msg);
  });
};

module.exports = {
  unsafePartialBecause: unsafePartialBecause,
  unsafeCrashWith: unsafeCrashWith,
  unsafePartial: $foreign.unsafePartial
};
},{"./foreign.js":"../output/Partial.Unsafe/foreign.js","../Partial/index.js":"../output/Partial/index.js"}],"../output/Data.List.NonEmpty/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_List = require("../Data.List/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_NonEmpty = require("../Data.NonEmpty/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semigroup_Traversable = require("../Data.Semigroup.Traversable/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Partial_Unsafe = require("../Partial.Unsafe/index.js");

var zipWith = function zipWith(f) {
  return function (v) {
    return function (v1) {
      return new Data_NonEmpty.NonEmpty(f(v.value0)(v1.value0), Data_List.zipWith(f)(v.value1)(v1.value1));
    };
  };
};

var zipWithA = function zipWithA(dictApplicative) {
  return function (f) {
    return function (xs) {
      return function (ys) {
        return Data_Semigroup_Traversable.sequence1(Data_List_Types.traversable1NonEmptyList)(dictApplicative.Apply0())(zipWith(f)(xs)(ys));
      };
    };
  };
};

var zip = zipWith(Data_Tuple.Tuple.create);

var wrappedOperation2 = function wrappedOperation2(name) {
  return function (f) {
    return function (v) {
      return function (v1) {
        var v2 = f(new Data_List_Types.Cons(v.value0, v.value1))(new Data_List_Types.Cons(v1.value0, v1.value1));

        if (v2 instanceof Data_List_Types.Cons) {
          return new Data_NonEmpty.NonEmpty(v2.value0, v2.value1);
        }

        ;

        if (v2 instanceof Data_List_Types.Nil) {
          return Partial_Unsafe.unsafeCrashWith("Impossible: empty list in NonEmptyList " + name);
        }

        ;
        throw new Error("Failed pattern match at Data.List.NonEmpty (line 104, column 3 - line 106, column 81): " + [v2.constructor.name]);
      };
    };
  };
};

var wrappedOperation = function wrappedOperation(name) {
  return function (f) {
    return function (v) {
      var v1 = f(new Data_List_Types.Cons(v.value0, v.value1));

      if (v1 instanceof Data_List_Types.Cons) {
        return new Data_NonEmpty.NonEmpty(v1.value0, v1.value1);
      }

      ;

      if (v1 instanceof Data_List_Types.Nil) {
        return Partial_Unsafe.unsafeCrashWith("Impossible: empty list in NonEmptyList " + name);
      }

      ;
      throw new Error("Failed pattern match at Data.List.NonEmpty (line 91, column 3 - line 93, column 81): " + [v1.constructor.name]);
    };
  };
};

var updateAt = function updateAt(i) {
  return function (a) {
    return function (v) {
      if (i === 0) {
        return new Data_Maybe.Just(new Data_NonEmpty.NonEmpty(a, v.value1));
      }

      ;

      if (Data_Boolean.otherwise) {
        return Data_Functor.map(Data_Maybe.functorMaybe)(function ($161) {
          return Data_List_Types.NonEmptyList(function (v1) {
            return new Data_NonEmpty.NonEmpty(v.value0, v1);
          }($161));
        })(Data_List.updateAt(i - 1 | 0)(a)(v.value1));
      }

      ;
      throw new Error("Failed pattern match at Data.List.NonEmpty (line 197, column 1 - line 197, column 75): " + [i.constructor.name, a.constructor.name, v.constructor.name]);
    };
  };
};

var unzip = function unzip(ts) {
  return new Data_Tuple.Tuple(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Data_Tuple.fst)(ts), Data_Functor.map(Data_List_Types.functorNonEmptyList)(Data_Tuple.snd)(ts));
};

var unsnoc = function unsnoc(v) {
  var v1 = Data_List.unsnoc(v.value1);

  if (v1 instanceof Data_Maybe.Nothing) {
    return {
      init: Data_List_Types.Nil.value,
      last: v.value0
    };
  }

  ;

  if (v1 instanceof Data_Maybe.Just) {
    return {
      init: new Data_List_Types.Cons(v.value0, v1.value0.init),
      last: v1.value0.last
    };
  }

  ;
  throw new Error("Failed pattern match at Data.List.NonEmpty (line 159, column 35 - line 161, column 50): " + [v1.constructor.name]);
};

var unionBy = function () {
  var $162 = wrappedOperation2("unionBy");
  return function ($163) {
    return $162(Data_List.unionBy($163));
  };
}();

var union = function union(dictEq) {
  return wrappedOperation2("union")(Data_List.union(dictEq));
};

var uncons = function uncons(v) {
  return {
    head: v.value0,
    tail: v.value1
  };
};

var toList = function toList(v) {
  return new Data_List_Types.Cons(v.value0, v.value1);
};

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  var $164 = Data_Unfoldable.unfoldr(dictUnfoldable)(function (xs) {
    return Data_Functor.map(Data_Maybe.functorMaybe)(function (rec) {
      return new Data_Tuple.Tuple(rec.head, rec.tail);
    })(Data_List.uncons(xs));
  });
  return function ($165) {
    return $164(toList($165));
  };
};

var tail = function tail(v) {
  return v.value1;
};

var sortBy = function () {
  var $166 = wrappedOperation("sortBy");
  return function ($167) {
    return $166(Data_List.sortBy($167));
  };
}();

var sort = function sort(dictOrd) {
  return function (xs) {
    return sortBy(Data_Ord.compare(dictOrd))(xs);
  };
};

var snoc = function snoc(v) {
  return function (y) {
    return new Data_NonEmpty.NonEmpty(v.value0, Data_List.snoc(v.value1)(y));
  };
};

var singleton = function () {
  var $168 = Data_NonEmpty.singleton(Data_List_Types.plusList);
  return function ($169) {
    return Data_List_Types.NonEmptyList($168($169));
  };
}();

var snoc$prime = function snoc$prime(v) {
  return function (y) {
    if (v instanceof Data_List_Types.Cons) {
      return new Data_NonEmpty.NonEmpty(v.value0, Data_List.snoc(v.value1)(y));
    }

    ;

    if (v instanceof Data_List_Types.Nil) {
      return singleton(y);
    }

    ;
    throw new Error("Failed pattern match at Data.List.NonEmpty (line 139, column 1 - line 139, column 51): " + [v.constructor.name, y.constructor.name]);
  };
};

var reverse = wrappedOperation("reverse")(Data_List.reverse);

var nubBy = function () {
  var $170 = wrappedOperation("nubBy");
  return function ($171) {
    return $170(Data_List.nubBy($171));
  };
}();

var nub = function nub(dictEq) {
  return wrappedOperation("nub")(Data_List.nub(dictEq));
};

var modifyAt = function modifyAt(i) {
  return function (f) {
    return function (v) {
      if (i === 0) {
        return new Data_Maybe.Just(new Data_NonEmpty.NonEmpty(f(v.value0), v.value1));
      }

      ;

      if (Data_Boolean.otherwise) {
        return Data_Functor.map(Data_Maybe.functorMaybe)(function ($172) {
          return Data_List_Types.NonEmptyList(function (v1) {
            return new Data_NonEmpty.NonEmpty(v.value0, v1);
          }($172));
        })(Data_List.modifyAt(i - 1 | 0)(f)(v.value1));
      }

      ;
      throw new Error("Failed pattern match at Data.List.NonEmpty (line 202, column 1 - line 202, column 82): " + [i.constructor.name, f.constructor.name, v.constructor.name]);
    };
  };
};

var mapWithIndex = Data_FunctorWithIndex.mapWithIndex(Data_List_Types.functorWithIndexNonEmptyList);

var lift = function lift(f) {
  return function (v) {
    return f(new Data_List_Types.Cons(v.value0, v.value1));
  };
};

var mapMaybe = function mapMaybe($173) {
  return lift(Data_List.mapMaybe($173));
};

var partition = function partition($174) {
  return lift(Data_List.partition($174));
};

var span = function span($175) {
  return lift(Data_List.span($175));
};

var take = function take($176) {
  return lift(Data_List.take($176));
};

var takeWhile = function takeWhile($177) {
  return lift(Data_List.takeWhile($177));
};

var length = function length(v) {
  return 1 + Data_List.length(v.value1) | 0;
};

var last = function last(v) {
  return Data_Maybe.fromMaybe(v.value0)(Data_List.last(v.value1));
};

var intersectBy = function () {
  var $178 = wrappedOperation2("intersectBy");
  return function ($179) {
    return $178(Data_List.intersectBy($179));
  };
}();

var intersect = function intersect(dictEq) {
  return wrappedOperation2("intersect")(Data_List.intersect(dictEq));
};

var insertAt = function insertAt(i) {
  return function (a) {
    return function (v) {
      if (i === 0) {
        return new Data_Maybe.Just(new Data_NonEmpty.NonEmpty(a, new Data_List_Types.Cons(v.value0, v.value1)));
      }

      ;

      if (Data_Boolean.otherwise) {
        return Data_Functor.map(Data_Maybe.functorMaybe)(function ($180) {
          return Data_List_Types.NonEmptyList(function (v1) {
            return new Data_NonEmpty.NonEmpty(v.value0, v1);
          }($180));
        })(Data_List.insertAt(i - 1 | 0)(a)(v.value1));
      }

      ;
      throw new Error("Failed pattern match at Data.List.NonEmpty (line 192, column 1 - line 192, column 75): " + [i.constructor.name, a.constructor.name, v.constructor.name]);
    };
  };
};

var init = function init(v) {
  return Data_Maybe.maybe(Data_List_Types.Nil.value)(function (v1) {
    return new Data_List_Types.Cons(v.value0, v1);
  })(Data_List.init(v.value1));
};

var index = function index(v) {
  return function (i) {
    if (i === 0) {
      return new Data_Maybe.Just(v.value0);
    }

    ;

    if (Data_Boolean.otherwise) {
      return Data_List.index(v.value1)(i - 1 | 0);
    }

    ;
    throw new Error("Failed pattern match at Data.List.NonEmpty (line 166, column 1 - line 166, column 52): " + [v.constructor.name, i.constructor.name]);
  };
};

var head = function head(v) {
  return v.value0;
};

var groupBy = function () {
  var $181 = wrappedOperation("groupBy");
  return function ($182) {
    return $181(Data_List.groupBy($182));
  };
}();

var group$prime = function group$prime(dictOrd) {
  return wrappedOperation("group'")(Data_List["group'"](dictOrd));
};

var group = function group(dictEq) {
  return wrappedOperation("group")(Data_List.group(dictEq));
};

var fromList = function fromList(v) {
  if (v instanceof Data_List_Types.Nil) {
    return Data_Maybe.Nothing.value;
  }

  ;

  if (v instanceof Data_List_Types.Cons) {
    return new Data_Maybe.Just(new Data_NonEmpty.NonEmpty(v.value0, v.value1));
  }

  ;
  throw new Error("Failed pattern match at Data.List.NonEmpty (line 120, column 1 - line 120, column 57): " + [v.constructor.name]);
};

var fromFoldable = function fromFoldable(dictFoldable) {
  var $183 = Data_List.fromFoldable(dictFoldable);
  return function ($184) {
    return fromList($183($184));
  };
};

var foldM = function foldM(dictMonad) {
  return function (f) {
    return function (a) {
      return function (v) {
        return Control_Bind.bind(dictMonad.Bind1())(f(a)(v.value0))(function (a$prime) {
          return Data_List.foldM(dictMonad)(f)(a$prime)(v.value1);
        });
      };
    };
  };
};

var findLastIndex = function findLastIndex(f) {
  return function (v) {
    var v1 = Data_List.findLastIndex(f)(v.value1);

    if (v1 instanceof Data_Maybe.Just) {
      return new Data_Maybe.Just(v1.value0 + 1 | 0);
    }

    ;

    if (v1 instanceof Data_Maybe.Nothing) {
      if (f(v.value0)) {
        return new Data_Maybe.Just(0);
      }

      ;

      if (Data_Boolean.otherwise) {
        return Data_Maybe.Nothing.value;
      }

      ;
    }

    ;
    throw new Error("Failed pattern match at Data.List.NonEmpty (line 186, column 3 - line 190, column 29): " + [v1.constructor.name]);
  };
};

var findIndex = function findIndex(f) {
  return function (v) {
    if (f(v.value0)) {
      return new Data_Maybe.Just(0);
    }

    ;

    if (Data_Boolean.otherwise) {
      return Data_Functor.map(Data_Maybe.functorMaybe)(function (v1) {
        return v1 + 1 | 0;
      })(Data_List.findIndex(f)(v.value1));
    }

    ;
    throw new Error("Failed pattern match at Data.List.NonEmpty (line 179, column 1 - line 179, column 69): " + [f.constructor.name, v.constructor.name]);
  };
};

var filterM = function filterM(dictMonad) {
  var $185 = Data_List.filterM(dictMonad);
  return function ($186) {
    return lift($185($186));
  };
};

var filter = function filter($187) {
  return lift(Data_List.filter($187));
};

var elemLastIndex = function elemLastIndex(dictEq) {
  return function (x) {
    return findLastIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var elemIndex = function elemIndex(dictEq) {
  return function (x) {
    return findIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var dropWhile = function dropWhile($188) {
  return lift(Data_List.dropWhile($188));
};

var drop = function drop($189) {
  return lift(Data_List.drop($189));
};

var cons$prime = function cons$prime(x) {
  return function (xs) {
    return new Data_NonEmpty.NonEmpty(x, xs);
  };
};

var cons = function cons(y) {
  return function (v) {
    return new Data_NonEmpty.NonEmpty(y, new Data_List_Types.Cons(v.value0, v.value1));
  };
};

var concatMap = Data_Function.flip(Control_Bind.bind(Data_List_Types.bindNonEmptyList));

var concat = function concat(v) {
  return Control_Bind.bind(Data_List_Types.bindNonEmptyList)(v)(Control_Category.identity(Control_Category.categoryFn));
};

var catMaybes = lift(Data_List.catMaybes);

var appendFoldable = function appendFoldable(dictFoldable) {
  return function (v) {
    return function (ys) {
      return new Data_NonEmpty.NonEmpty(v.value0, Data_Semigroup.append(Data_List_Types.semigroupList)(v.value1)(Data_List.fromFoldable(dictFoldable)(ys)));
    };
  };
};

module.exports = {
  toUnfoldable: toUnfoldable,
  fromFoldable: fromFoldable,
  fromList: fromList,
  toList: toList,
  singleton: singleton,
  length: length,
  cons: cons,
  "cons'": cons$prime,
  snoc: snoc,
  "snoc'": snoc$prime,
  head: head,
  last: last,
  tail: tail,
  init: init,
  uncons: uncons,
  unsnoc: unsnoc,
  index: index,
  elemIndex: elemIndex,
  elemLastIndex: elemLastIndex,
  findIndex: findIndex,
  findLastIndex: findLastIndex,
  insertAt: insertAt,
  updateAt: updateAt,
  modifyAt: modifyAt,
  reverse: reverse,
  concat: concat,
  concatMap: concatMap,
  filter: filter,
  filterM: filterM,
  mapMaybe: mapMaybe,
  catMaybes: catMaybes,
  appendFoldable: appendFoldable,
  mapWithIndex: mapWithIndex,
  sort: sort,
  sortBy: sortBy,
  take: take,
  takeWhile: takeWhile,
  drop: drop,
  dropWhile: dropWhile,
  span: span,
  group: group,
  "group'": group$prime,
  groupBy: groupBy,
  partition: partition,
  nub: nub,
  nubBy: nubBy,
  union: union,
  unionBy: unionBy,
  intersect: intersect,
  intersectBy: intersectBy,
  zipWith: zipWith,
  zipWithA: zipWithA,
  zip: zip,
  unzip: unzip,
  foldM: foldM
};
},{"../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.List/index.js":"../output/Data.List/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.NonEmpty/index.js":"../output/Data.NonEmpty/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semigroup.Traversable/index.js":"../output/Data.Semigroup.Traversable/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js","../Partial.Unsafe/index.js":"../output/Partial.Unsafe/index.js"}],"../output/Data.String.CodeUnits/foreign.js":[function(require,module,exports) {
"use strict";

exports.fromCharArray = function (a) {
  return a.join("");
};

exports.toCharArray = function (s) {
  return s.split("");
};

exports.singleton = function (c) {
  return c;
};

exports._charAt = function (just) {
  return function (nothing) {
    return function (i) {
      return function (s) {
        return i >= 0 && i < s.length ? just(s.charAt(i)) : nothing;
      };
    };
  };
};

exports._toChar = function (just) {
  return function (nothing) {
    return function (s) {
      return s.length === 1 ? just(s) : nothing;
    };
  };
};

exports.length = function (s) {
  return s.length;
};

exports.countPrefix = function (p) {
  return function (s) {
    var i = 0;

    while (i < s.length && p(s.charAt(i))) {
      i++;
    }

    return i;
  };
};

exports._indexOf = function (just) {
  return function (nothing) {
    return function (x) {
      return function (s) {
        var i = s.indexOf(x);
        return i === -1 ? nothing : just(i);
      };
    };
  };
};

exports["_indexOf'"] = function (just) {
  return function (nothing) {
    return function (x) {
      return function (startAt) {
        return function (s) {
          if (startAt < 0 || startAt > s.length) return nothing;
          var i = s.indexOf(x, startAt);
          return i === -1 ? nothing : just(i);
        };
      };
    };
  };
};

exports._lastIndexOf = function (just) {
  return function (nothing) {
    return function (x) {
      return function (s) {
        var i = s.lastIndexOf(x);
        return i === -1 ? nothing : just(i);
      };
    };
  };
};

exports["_lastIndexOf'"] = function (just) {
  return function (nothing) {
    return function (x) {
      return function (startAt) {
        return function (s) {
          if (startAt < 0 || startAt > s.length) return nothing;
          var i = s.lastIndexOf(x, startAt);
          return i === -1 ? nothing : just(i);
        };
      };
    };
  };
};

exports.take = function (n) {
  return function (s) {
    return s.substr(0, n);
  };
};

exports.drop = function (n) {
  return function (s) {
    return s.substring(n);
  };
};

exports._slice = function (b) {
  return function (e) {
    return function (s) {
      return s.slice(b, e);
    };
  };
};

exports.splitAt = function (i) {
  return function (s) {
    return {
      before: s.substring(0, i),
      after: s.substring(i)
    };
  };
};
},{}],"../output/Data.String.Unsafe/foreign.js":[function(require,module,exports) {
"use strict";

exports.charAt = function (i) {
  return function (s) {
    if (i >= 0 && i < s.length) return s.charAt(i);
    throw new Error("Data.String.Unsafe.charAt: Invalid index.");
  };
};

exports.char = function (s) {
  if (s.length === 1) return s.charAt(0);
  throw new Error("Data.String.Unsafe.char: Expected string of length 1.");
};
},{}],"../output/Data.String.Unsafe/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

module.exports = {
  "char": $foreign["char"],
  charAt: $foreign.charAt
};
},{"./foreign.js":"../output/Data.String.Unsafe/foreign.js"}],"../output/Data.String.CodeUnits/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_String_Unsafe = require("../Data.String.Unsafe/index.js");

var uncons = function uncons(v) {
  if (v === "") {
    return Data_Maybe.Nothing.value;
  }

  ;
  return new Data_Maybe.Just({
    head: Data_String_Unsafe.charAt(0)(v),
    tail: $foreign.drop(1)(v)
  });
};

var toChar = $foreign["_toChar"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var takeWhile = function takeWhile(p) {
  return function (s) {
    return $foreign.take($foreign.countPrefix(p)(s))(s);
  };
};

var takeRight = function takeRight(i) {
  return function (s) {
    return $foreign.drop($foreign.length(s) - i | 0)(s);
  };
};

var slice = function slice(b) {
  return function (e) {
    return function (s) {
      var l = $foreign.length(s);

      var norm = function norm(x) {
        if (x < 0) {
          return l + x | 0;
        }

        ;

        if (Data_Boolean.otherwise) {
          return x;
        }

        ;
        throw new Error("Failed pattern match at Data.String.CodeUnits (line 314, column 5 - line 315, column 27): " + [x.constructor.name]);
      };

      var e$prime = norm(e);
      var b$prime = norm(b);
      var $7 = b$prime < 0 || b$prime >= l || e$prime < 0 || e$prime > l || b$prime > e$prime;

      if ($7) {
        return Data_Maybe.Nothing.value;
      }

      ;
      return new Data_Maybe.Just($foreign["_slice"](b)(e)(s));
    };
  };
};

var lastIndexOf$prime = $foreign["_lastIndexOf'"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
var lastIndexOf = $foreign["_lastIndexOf"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var stripSuffix = function stripSuffix(v) {
  return function (str) {
    var v1 = lastIndexOf(v)(str);

    if (v1 instanceof Data_Maybe.Just && v1.value0 === ($foreign.length(str) - $foreign.length(v) | 0)) {
      return Data_Maybe.Just.create($foreign.take(v1.value0)(str));
    }

    ;
    return Data_Maybe.Nothing.value;
  };
};

var indexOf$prime = $foreign["_indexOf'"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
var indexOf = $foreign["_indexOf"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var stripPrefix = function stripPrefix(v) {
  return function (str) {
    var v1 = indexOf(v)(str);

    if (v1 instanceof Data_Maybe.Just && v1.value0 === 0) {
      return Data_Maybe.Just.create($foreign.drop($foreign.length(v))(str));
    }

    ;
    return Data_Maybe.Nothing.value;
  };
};

var dropWhile = function dropWhile(p) {
  return function (s) {
    return $foreign.drop($foreign.countPrefix(p)(s))(s);
  };
};

var dropRight = function dropRight(i) {
  return function (s) {
    return $foreign.take($foreign.length(s) - i | 0)(s);
  };
};

var contains = function contains(pat) {
  var $16 = indexOf(pat);
  return function ($17) {
    return Data_Maybe.isJust($16($17));
  };
};

var charAt = $foreign["_charAt"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
module.exports = {
  stripPrefix: stripPrefix,
  stripSuffix: stripSuffix,
  contains: contains,
  charAt: charAt,
  toChar: toChar,
  uncons: uncons,
  indexOf: indexOf,
  "indexOf'": indexOf$prime,
  lastIndexOf: lastIndexOf,
  "lastIndexOf'": lastIndexOf$prime,
  takeRight: takeRight,
  takeWhile: takeWhile,
  dropRight: dropRight,
  dropWhile: dropWhile,
  slice: slice,
  singleton: $foreign.singleton,
  fromCharArray: $foreign.fromCharArray,
  toCharArray: $foreign.toCharArray,
  length: $foreign.length,
  countPrefix: $foreign.countPrefix,
  take: $foreign.take,
  drop: $foreign.drop,
  splitAt: $foreign.splitAt
};
},{"./foreign.js":"../output/Data.String.CodeUnits/foreign.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.String.Unsafe/index.js":"../output/Data.String.Unsafe/index.js"}],"../output/Foreign/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Monad_Error_Class = require("../Control.Monad.Error.Class/index.js");

var Control_Monad_Except = require("../Control.Monad.Except/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Int = require("../Data.Int/index.js");

var Data_List_NonEmpty = require("../Data.List.NonEmpty/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_String_CodeUnits = require("../Data.String.CodeUnits/index.js");

var ForeignError = function () {
  function ForeignError(value0) {
    this.value0 = value0;
  }

  ;

  ForeignError.create = function (value0) {
    return new ForeignError(value0);
  };

  return ForeignError;
}();

var TypeMismatch = function () {
  function TypeMismatch(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  TypeMismatch.create = function (value0) {
    return function (value1) {
      return new TypeMismatch(value0, value1);
    };
  };

  return TypeMismatch;
}();

var ErrorAtIndex = function () {
  function ErrorAtIndex(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  ErrorAtIndex.create = function (value0) {
    return function (value1) {
      return new ErrorAtIndex(value0, value1);
    };
  };

  return ErrorAtIndex;
}();

var ErrorAtProperty = function () {
  function ErrorAtProperty(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  ErrorAtProperty.create = function (value0) {
    return function (value1) {
      return new ErrorAtProperty(value0, value1);
    };
  };

  return ErrorAtProperty;
}();

var showForeignError = new Data_Show.Show(function (v) {
  if (v instanceof ForeignError) {
    return "(ForeignError " + (Data_Show.show(Data_Show.showString)(v.value0) + ")");
  }

  ;

  if (v instanceof ErrorAtIndex) {
    return "(ErrorAtIndex " + (Data_Show.show(Data_Show.showInt)(v.value0) + (" " + (Data_Show.show(showForeignError)(v.value1) + ")")));
  }

  ;

  if (v instanceof ErrorAtProperty) {
    return "(ErrorAtProperty " + (Data_Show.show(Data_Show.showString)(v.value0) + (" " + (Data_Show.show(showForeignError)(v.value1) + ")")));
  }

  ;

  if (v instanceof TypeMismatch) {
    return "(TypeMismatch " + (Data_Show.show(Data_Show.showString)(v.value0) + (" " + (Data_Show.show(Data_Show.showString)(v.value1) + ")")));
  }

  ;
  throw new Error("Failed pattern match at Foreign (line 63, column 1 - line 67, column 89): " + [v.constructor.name]);
});

var renderForeignError = function renderForeignError(v) {
  if (v instanceof ForeignError) {
    return v.value0;
  }

  ;

  if (v instanceof ErrorAtIndex) {
    return "Error at array index " + (Data_Show.show(Data_Show.showInt)(v.value0) + (": " + renderForeignError(v.value1)));
  }

  ;

  if (v instanceof ErrorAtProperty) {
    return "Error at property " + (Data_Show.show(Data_Show.showString)(v.value0) + (": " + renderForeignError(v.value1)));
  }

  ;

  if (v instanceof TypeMismatch) {
    return "Type mismatch: expected " + (v.value0 + (", found " + v.value1));
  }

  ;
  throw new Error("Failed pattern match at Foreign (line 72, column 1 - line 72, column 45): " + [v.constructor.name]);
};

var readUndefined = function readUndefined(value) {
  if ($foreign.isUndefined(value)) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Maybe.Nothing.value);
  }

  ;

  if (Data_Boolean.otherwise) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(new Data_Maybe.Just(value));
  }

  ;
  throw new Error("Failed pattern match at Foreign (line 157, column 1 - line 157, column 46): " + [value.constructor.name]);
};

var readNullOrUndefined = function readNullOrUndefined(value) {
  if ($foreign.isNull(value) || $foreign.isUndefined(value)) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Maybe.Nothing.value);
  }

  ;

  if (Data_Boolean.otherwise) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(new Data_Maybe.Just(value));
  }

  ;
  throw new Error("Failed pattern match at Foreign (line 162, column 1 - line 162, column 52): " + [value.constructor.name]);
};

var readNull = function readNull(value) {
  if ($foreign.isNull(value)) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Maybe.Nothing.value);
  }

  ;

  if (Data_Boolean.otherwise) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(new Data_Maybe.Just(value));
  }

  ;
  throw new Error("Failed pattern match at Foreign (line 152, column 1 - line 152, column 41): " + [value.constructor.name]);
};

var fail = function () {
  var $107 = Control_Monad_Error_Class.throwError(Control_Monad_Except_Trans.monadThrowExceptT(Data_Identity.monadIdentity));
  return function ($108) {
    return $107(Data_List_NonEmpty.singleton($108));
  };
}();

var readArray = function readArray(value) {
  if ($foreign.isArray(value)) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))($foreign.unsafeFromForeign(value));
  }

  ;

  if (Data_Boolean.otherwise) {
    return fail(new TypeMismatch("array", $foreign.tagOf(value)));
  }

  ;
  throw new Error("Failed pattern match at Foreign (line 147, column 1 - line 147, column 42): " + [value.constructor.name]);
};

var unsafeReadTagged = function unsafeReadTagged(tag) {
  return function (value) {
    if ($foreign.tagOf(value) === tag) {
      return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))($foreign.unsafeFromForeign(value));
    }

    ;

    if (Data_Boolean.otherwise) {
      return fail(new TypeMismatch(tag, $foreign.tagOf(value)));
    }

    ;
    throw new Error("Failed pattern match at Foreign (line 106, column 1 - line 106, column 55): " + [tag.constructor.name, value.constructor.name]);
  };
};

var readBoolean = unsafeReadTagged("Boolean");
var readNumber = unsafeReadTagged("Number");

var readInt = function readInt(value) {
  var error = Data_Either.Left.create(Data_List_NonEmpty.singleton(new TypeMismatch("Int", $foreign.tagOf(value))));

  var fromNumber = function () {
    var $109 = Data_Maybe.maybe(error)(Control_Applicative.pure(Data_Either.applicativeEither));
    return function ($110) {
      return $109(Data_Int.fromNumber($110));
    };
  }();

  return Control_Monad_Except.mapExcept(Data_Either.either(Data_Function["const"](error))(fromNumber))(readNumber(value));
};

var readString = unsafeReadTagged("String");

var readChar = function readChar(value) {
  var error = Data_Either.Left.create(Data_List_NonEmpty.singleton(new TypeMismatch("Char", $foreign.tagOf(value))));

  var fromString = function () {
    var $111 = Data_Maybe.maybe(error)(Control_Applicative.pure(Data_Either.applicativeEither));
    return function ($112) {
      return $111(Data_String_CodeUnits.toChar($112));
    };
  }();

  return Control_Monad_Except.mapExcept(Data_Either.either(Data_Function["const"](error))(fromString))(readString(value));
};

var eqForeignError = new Data_Eq.Eq(function (x) {
  return function (y) {
    if (x instanceof ForeignError && y instanceof ForeignError) {
      return x.value0 === y.value0;
    }

    ;

    if (x instanceof TypeMismatch && y instanceof TypeMismatch) {
      return x.value0 === y.value0 && x.value1 === y.value1;
    }

    ;

    if (x instanceof ErrorAtIndex && y instanceof ErrorAtIndex) {
      return x.value0 === y.value0 && Data_Eq.eq(eqForeignError)(x.value1)(y.value1);
    }

    ;

    if (x instanceof ErrorAtProperty && y instanceof ErrorAtProperty) {
      return x.value0 === y.value0 && Data_Eq.eq(eqForeignError)(x.value1)(y.value1);
    }

    ;
    return false;
  };
});
var ordForeignError = new Data_Ord.Ord(function () {
  return eqForeignError;
}, function (x) {
  return function (y) {
    if (x instanceof ForeignError && y instanceof ForeignError) {
      return Data_Ord.compare(Data_Ord.ordString)(x.value0)(y.value0);
    }

    ;

    if (x instanceof ForeignError) {
      return Data_Ordering.LT.value;
    }

    ;

    if (y instanceof ForeignError) {
      return Data_Ordering.GT.value;
    }

    ;

    if (x instanceof TypeMismatch && y instanceof TypeMismatch) {
      var v = Data_Ord.compare(Data_Ord.ordString)(x.value0)(y.value0);

      if (v instanceof Data_Ordering.LT) {
        return Data_Ordering.LT.value;
      }

      ;

      if (v instanceof Data_Ordering.GT) {
        return Data_Ordering.GT.value;
      }

      ;
      return Data_Ord.compare(Data_Ord.ordString)(x.value1)(y.value1);
    }

    ;

    if (x instanceof TypeMismatch) {
      return Data_Ordering.LT.value;
    }

    ;

    if (y instanceof TypeMismatch) {
      return Data_Ordering.GT.value;
    }

    ;

    if (x instanceof ErrorAtIndex && y instanceof ErrorAtIndex) {
      var v = Data_Ord.compare(Data_Ord.ordInt)(x.value0)(y.value0);

      if (v instanceof Data_Ordering.LT) {
        return Data_Ordering.LT.value;
      }

      ;

      if (v instanceof Data_Ordering.GT) {
        return Data_Ordering.GT.value;
      }

      ;
      return Data_Ord.compare(ordForeignError)(x.value1)(y.value1);
    }

    ;

    if (x instanceof ErrorAtIndex) {
      return Data_Ordering.LT.value;
    }

    ;

    if (y instanceof ErrorAtIndex) {
      return Data_Ordering.GT.value;
    }

    ;

    if (x instanceof ErrorAtProperty && y instanceof ErrorAtProperty) {
      var v = Data_Ord.compare(Data_Ord.ordString)(x.value0)(y.value0);

      if (v instanceof Data_Ordering.LT) {
        return Data_Ordering.LT.value;
      }

      ;

      if (v instanceof Data_Ordering.GT) {
        return Data_Ordering.GT.value;
      }

      ;
      return Data_Ord.compare(ordForeignError)(x.value1)(y.value1);
    }

    ;
    throw new Error("Failed pattern match at Foreign (line 61, column 1 - line 61, column 52): " + [x.constructor.name, y.constructor.name]);
  };
});
module.exports = {
  ForeignError: ForeignError,
  TypeMismatch: TypeMismatch,
  ErrorAtIndex: ErrorAtIndex,
  ErrorAtProperty: ErrorAtProperty,
  renderForeignError: renderForeignError,
  unsafeReadTagged: unsafeReadTagged,
  readString: readString,
  readChar: readChar,
  readBoolean: readBoolean,
  readNumber: readNumber,
  readInt: readInt,
  readArray: readArray,
  readNull: readNull,
  readUndefined: readUndefined,
  readNullOrUndefined: readNullOrUndefined,
  fail: fail,
  eqForeignError: eqForeignError,
  ordForeignError: ordForeignError,
  showForeignError: showForeignError,
  unsafeToForeign: $foreign.unsafeToForeign,
  unsafeFromForeign: $foreign.unsafeFromForeign,
  typeOf: $foreign.typeOf,
  tagOf: $foreign.tagOf,
  isNull: $foreign.isNull,
  isUndefined: $foreign.isUndefined,
  isArray: $foreign.isArray
};
},{"./foreign.js":"../output/Foreign/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Monad.Error.Class/index.js":"../output/Control.Monad.Error.Class/index.js","../Control.Monad.Except/index.js":"../output/Control.Monad.Except/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Int/index.js":"../output/Data.Int/index.js","../Data.List.NonEmpty/index.js":"../output/Data.List.NonEmpty/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.String.CodeUnits/index.js":"../output/Data.String.CodeUnits/index.js"}],"../output/Data.Generic.Rep/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Maybe = require("../Data.Maybe/index.js");

var Inl = function () {
  function Inl(value0) {
    this.value0 = value0;
  }

  ;

  Inl.create = function (value0) {
    return new Inl(value0);
  };

  return Inl;
}();

var Inr = function () {
  function Inr(value0) {
    this.value0 = value0;
  }

  ;

  Inr.create = function (value0) {
    return new Inr(value0);
  };

  return Inr;
}();

var Product = function () {
  function Product(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Product.create = function (value0) {
    return function (value1) {
      return new Product(value0, value1);
    };
  };

  return Product;
}();

var NoArguments = function () {
  function NoArguments() {}

  ;
  NoArguments.value = new NoArguments();
  return NoArguments;
}();

var Constructor = function Constructor(x) {
  return x;
};

var Argument = function Argument(x) {
  return x;
};

var Generic = function Generic(from, to) {
  this.from = from;
  this.to = to;
};

var to = function to(dict) {
  return dict.to;
};

var genericMaybe = new Generic(function (v) {
  if (v instanceof Data_Maybe.Nothing) {
    return new Inl(NoArguments.value);
  }

  ;

  if (v instanceof Data_Maybe.Just) {
    return new Inr(v.value0);
  }

  ;
  throw new Error("Failed pattern match at Data.Generic.Rep (line 40, column 1 - line 47, column 49): " + [v.constructor.name]);
}, function (v) {
  if (v instanceof Inl) {
    return Data_Maybe.Nothing.value;
  }

  ;

  if (v instanceof Inr) {
    return new Data_Maybe.Just(v.value0);
  }

  ;
  throw new Error("Failed pattern match at Data.Generic.Rep (line 40, column 1 - line 47, column 49): " + [v.constructor.name]);
});

var from = function from(dict) {
  return dict.from;
};

module.exports = {
  Generic: Generic,
  to: to,
  from: from,
  NoArguments: NoArguments,
  Inl: Inl,
  Inr: Inr,
  Product: Product,
  Constructor: Constructor,
  Argument: Argument,
  genericMaybe: genericMaybe
};
},{"../Data.Maybe/index.js":"../output/Data.Maybe/index.js"}],"../output/Data.Array/foreign.js":[function(require,module,exports) {
"use strict"; //------------------------------------------------------------------------------
// Array creation --------------------------------------------------------------
//------------------------------------------------------------------------------

exports.range = function (start) {
  return function (end) {
    var step = start > end ? -1 : 1;
    var result = new Array(step * (end - start) + 1);
    var i = start,
        n = 0;

    while (i !== end) {
      result[n++] = i;
      i += step;
    }

    result[n] = i;
    return result;
  };
};

var replicateFill = function replicateFill(count) {
  return function (value) {
    if (count < 1) {
      return [];
    }

    var result = new Array(count);
    return result.fill(value);
  };
};

var replicatePolyfill = function replicatePolyfill(count) {
  return function (value) {
    var result = [];
    var n = 0;

    for (var i = 0; i < count; i++) {
      result[n++] = value;
    }

    return result;
  };
}; // In browsers that have Array.prototype.fill we use it, as it's faster.


exports.replicate = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill;

exports.fromFoldableImpl = function () {
  function Cons(head, tail) {
    this.head = head;
    this.tail = tail;
  }

  var emptyList = {};

  function curryCons(head) {
    return function (tail) {
      return new Cons(head, tail);
    };
  }

  function listToArray(list) {
    var result = [];
    var count = 0;
    var xs = list;

    while (xs !== emptyList) {
      result[count++] = xs.head;
      xs = xs.tail;
    }

    return result;
  }

  return function (foldr) {
    return function (xs) {
      return listToArray(foldr(curryCons)(emptyList)(xs));
    };
  };
}(); //------------------------------------------------------------------------------
// Array size ------------------------------------------------------------------
//------------------------------------------------------------------------------


exports.length = function (xs) {
  return xs.length;
}; //------------------------------------------------------------------------------
// Extending arrays ------------------------------------------------------------
//------------------------------------------------------------------------------


exports.cons = function (e) {
  return function (l) {
    return [e].concat(l);
  };
};

exports.snoc = function (l) {
  return function (e) {
    var l1 = l.slice();
    l1.push(e);
    return l1;
  };
}; //------------------------------------------------------------------------------
// Non-indexed reads -----------------------------------------------------------
//------------------------------------------------------------------------------


exports["uncons'"] = function (empty) {
  return function (next) {
    return function (xs) {
      return xs.length === 0 ? empty({}) : next(xs[0])(xs.slice(1));
    };
  };
}; //------------------------------------------------------------------------------
// Indexed operations ----------------------------------------------------------
//------------------------------------------------------------------------------


exports.indexImpl = function (just) {
  return function (nothing) {
    return function (xs) {
      return function (i) {
        return i < 0 || i >= xs.length ? nothing : just(xs[i]);
      };
    };
  };
};

exports.findIndexImpl = function (just) {
  return function (nothing) {
    return function (f) {
      return function (xs) {
        for (var i = 0, l = xs.length; i < l; i++) {
          if (f(xs[i])) return just(i);
        }

        return nothing;
      };
    };
  };
};

exports.findLastIndexImpl = function (just) {
  return function (nothing) {
    return function (f) {
      return function (xs) {
        for (var i = xs.length - 1; i >= 0; i--) {
          if (f(xs[i])) return just(i);
        }

        return nothing;
      };
    };
  };
};

exports._insertAt = function (just) {
  return function (nothing) {
    return function (i) {
      return function (a) {
        return function (l) {
          if (i < 0 || i > l.length) return nothing;
          var l1 = l.slice();
          l1.splice(i, 0, a);
          return just(l1);
        };
      };
    };
  };
};

exports._deleteAt = function (just) {
  return function (nothing) {
    return function (i) {
      return function (l) {
        if (i < 0 || i >= l.length) return nothing;
        var l1 = l.slice();
        l1.splice(i, 1);
        return just(l1);
      };
    };
  };
};

exports._updateAt = function (just) {
  return function (nothing) {
    return function (i) {
      return function (a) {
        return function (l) {
          if (i < 0 || i >= l.length) return nothing;
          var l1 = l.slice();
          l1[i] = a;
          return just(l1);
        };
      };
    };
  };
}; //------------------------------------------------------------------------------
// Transformations -------------------------------------------------------------
//------------------------------------------------------------------------------


exports.reverse = function (l) {
  return l.slice().reverse();
};

exports.concat = function (xss) {
  if (xss.length <= 10000) {
    // This method is faster, but it crashes on big arrays.
    // So we use it when can and fallback to simple variant otherwise.
    return Array.prototype.concat.apply([], xss);
  }

  var result = [];

  for (var i = 0, l = xss.length; i < l; i++) {
    var xs = xss[i];

    for (var j = 0, m = xs.length; j < m; j++) {
      result.push(xs[j]);
    }
  }

  return result;
};

exports.filter = function (f) {
  return function (xs) {
    return xs.filter(f);
  };
};

exports.partition = function (f) {
  return function (xs) {
    var yes = [];
    var no = [];

    for (var i = 0; i < xs.length; i++) {
      var x = xs[i];
      if (f(x)) yes.push(x);else no.push(x);
    }

    return {
      yes: yes,
      no: no
    };
  };
}; //------------------------------------------------------------------------------
// Sorting ---------------------------------------------------------------------
//------------------------------------------------------------------------------


exports.sortImpl = function (f) {
  return function (l) {
    return l.slice().sort(function (x, y) {
      return f(x)(y);
    });
  };
}; //------------------------------------------------------------------------------
// Subarrays -------------------------------------------------------------------
//------------------------------------------------------------------------------


exports.slice = function (s) {
  return function (e) {
    return function (l) {
      return l.slice(s, e);
    };
  };
};

exports.take = function (n) {
  return function (l) {
    return n < 1 ? [] : l.slice(0, n);
  };
};

exports.drop = function (n) {
  return function (l) {
    return n < 1 ? l : l.slice(n);
  };
}; //------------------------------------------------------------------------------
// Zipping ---------------------------------------------------------------------
//------------------------------------------------------------------------------


exports.zipWith = function (f) {
  return function (xs) {
    return function (ys) {
      var l = xs.length < ys.length ? xs.length : ys.length;
      var result = new Array(l);

      for (var i = 0; i < l; i++) {
        result[i] = f(xs[i])(ys[i]);
      }

      return result;
    };
  };
}; //------------------------------------------------------------------------------
// Partial ---------------------------------------------------------------------
//------------------------------------------------------------------------------


exports.unsafeIndexImpl = function (xs) {
  return function (n) {
    return xs[n];
  };
};
},{}],"../output/Control.Monad.ST.Internal/foreign.js":[function(require,module,exports) {
"use strict";

exports.map_ = function (f) {
  return function (a) {
    return function () {
      return f(a());
    };
  };
};

exports.pure_ = function (a) {
  return function () {
    return a;
  };
};

exports.bind_ = function (a) {
  return function (f) {
    return function () {
      return f(a())();
    };
  };
};

exports.run = function (f) {
  return f();
};

exports["while"] = function (f) {
  return function (a) {
    return function () {
      while (f()) {
        a();
      }
    };
  };
};

exports["for"] = function (lo) {
  return function (hi) {
    return function (f) {
      return function () {
        for (var i = lo; i < hi; i++) {
          f(i)();
        }
      };
    };
  };
};

exports.foreach = function (as) {
  return function (f) {
    return function () {
      for (var i = 0, l = as.length; i < l; i++) {
        f(as[i])();
      }
    };
  };
};

exports.new = function (val) {
  return function () {
    return {
      value: val
    };
  };
};

exports.read = function (ref) {
  return function () {
    return ref.value;
  };
};

exports["modify'"] = function (f) {
  return function (ref) {
    return function () {
      var t = f(ref.value);
      ref.value = t.state;
      return t.value;
    };
  };
};

exports.write = function (a) {
  return function (ref) {
    return function () {
      return ref.value = a; // eslint-disable-line no-return-assign
    };
  };
};
},{}],"../output/Control.Monad.ST.Internal/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var modify = function modify(f) {
  return $foreign["modify'"](function (s) {
    var s$prime = f(s);
    return {
      state: s$prime,
      value: s$prime
    };
  });
};

var functorST = new Data_Functor.Functor($foreign.map_);
var monadST = new Control_Monad.Monad(function () {
  return applicativeST;
}, function () {
  return bindST;
});
var bindST = new Control_Bind.Bind(function () {
  return applyST;
}, $foreign.bind_);
var applyST = new Control_Apply.Apply(function () {
  return functorST;
}, Control_Monad.ap(monadST));
var applicativeST = new Control_Applicative.Applicative(function () {
  return applyST;
}, $foreign.pure_);
var monadRecST = new Control_Monad_Rec_Class.MonadRec(function () {
  return monadST;
}, function (f) {
  return function (a) {
    var isLooping = function isLooping(v) {
      if (v instanceof Control_Monad_Rec_Class.Loop) {
        return true;
      }

      ;
      return false;
    };

    var fromDone = function fromDone(v) {
      if (v instanceof Control_Monad_Rec_Class.Done) {
        return v.value0;
      }

      ;
      throw new Error("Failed pattern match at Control.Monad.ST.Internal (line 54, column 32 - line 54, column 46): " + [v.constructor.name]);
    };

    return Control_Bind.bind(bindST)(Control_Bind.bindFlipped(bindST)($foreign["new"])(f(a)))(function (r) {
      return Control_Bind.discard(Control_Bind.discardUnit)(bindST)($foreign["while"](Data_Functor.map(functorST)(isLooping)($foreign.read(r)))(Control_Bind.bind(bindST)($foreign.read(r))(function (v) {
        if (v instanceof Control_Monad_Rec_Class.Loop) {
          return Control_Bind.bind(bindST)(f(v.value0))(function (e) {
            return Data_Functor["void"](functorST)($foreign.write(e)(r));
          });
        }

        ;

        if (v instanceof Control_Monad_Rec_Class.Done) {
          return Control_Applicative.pure(applicativeST)(Data_Unit.unit);
        }

        ;
        throw new Error("Failed pattern match at Control.Monad.ST.Internal (line 46, column 18 - line 50, column 28): " + [v.constructor.name]);
      })))(function () {
        return Data_Functor.map(functorST)(fromDone)($foreign.read(r));
      });
    });
  };
});
module.exports = {
  modify: modify,
  functorST: functorST,
  applyST: applyST,
  applicativeST: applicativeST,
  bindST: bindST,
  monadST: monadST,
  monadRecST: monadRecST,
  map_: $foreign.map_,
  pure_: $foreign.pure_,
  bind_: $foreign.bind_,
  run: $foreign.run,
  "while": $foreign["while"],
  "for": $foreign["for"],
  foreach: $foreign.foreach,
  "new": $foreign["new"],
  read: $foreign.read,
  "modify'": $foreign["modify'"],
  write: $foreign.write
};
},{"./foreign.js":"../output/Control.Monad.ST.Internal/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Array.ST/foreign.js":[function(require,module,exports) {
"use strict";

exports.empty = function () {
  return [];
};

exports.peekImpl = function (just) {
  return function (nothing) {
    return function (i) {
      return function (xs) {
        return function () {
          return i >= 0 && i < xs.length ? just(xs[i]) : nothing;
        };
      };
    };
  };
};

exports.poke = function (i) {
  return function (a) {
    return function (xs) {
      return function () {
        var ret = i >= 0 && i < xs.length;
        if (ret) xs[i] = a;
        return ret;
      };
    };
  };
};

exports.popImpl = function (just) {
  return function (nothing) {
    return function (xs) {
      return function () {
        return xs.length > 0 ? just(xs.pop()) : nothing;
      };
    };
  };
};

exports.pushAll = function (as) {
  return function (xs) {
    return function () {
      return xs.push.apply(xs, as);
    };
  };
};

exports.shiftImpl = function (just) {
  return function (nothing) {
    return function (xs) {
      return function () {
        return xs.length > 0 ? just(xs.shift()) : nothing;
      };
    };
  };
};

exports.unshiftAll = function (as) {
  return function (xs) {
    return function () {
      return xs.unshift.apply(xs, as);
    };
  };
};

exports.splice = function (i) {
  return function (howMany) {
    return function (bs) {
      return function (xs) {
        return function () {
          return xs.splice.apply(xs, [i, howMany].concat(bs));
        };
      };
    };
  };
};

exports.unsafeFreeze = function (xs) {
  return function () {
    return xs;
  };
};

exports.unsafeThaw = function (xs) {
  return function () {
    return xs;
  };
};

function copyImpl(xs) {
  return function () {
    return xs.slice();
  };
}

exports.freeze = copyImpl;
exports.thaw = copyImpl;

exports.sortByImpl = function (comp) {
  return function (xs) {
    return function () {
      return xs.sort(function (x, y) {
        return comp(x)(y);
      });
    };
  };
};

exports.toAssocArray = function (xs) {
  return function () {
    var n = xs.length;
    var as = new Array(n);

    for (var i = 0; i < n; i++) {
      as[i] = {
        value: xs[i],
        index: i
      };
    }

    return as;
  };
};
},{}],"../output/Data.Array.ST/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad_ST_Internal = require("../Control.Monad.ST.Internal/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var withArray = function withArray(f) {
  return function (xs) {
    return function __do() {
      var result = $foreign.thaw(xs)();
      f(result)();
      return $foreign.unsafeFreeze(result)();
    };
  };
};

var unshift = function unshift(a) {
  return $foreign.unshiftAll([a]);
};

var sortBy = function sortBy(comp) {
  var comp$prime = function comp$prime(x) {
    return function (y) {
      var v = comp(x)(y);

      if (v instanceof Data_Ordering.GT) {
        return 1;
      }

      ;

      if (v instanceof Data_Ordering.EQ) {
        return 0;
      }

      ;

      if (v instanceof Data_Ordering.LT) {
        return -1 | 0;
      }

      ;
      throw new Error("Failed pattern match at Data.Array.ST (line 105, column 15 - line 108, column 13): " + [v.constructor.name]);
    };
  };

  return $foreign.sortByImpl(comp$prime);
};

var sortWith = function sortWith(dictOrd) {
  return function (f) {
    return sortBy(Data_Ord.comparing(dictOrd)(f));
  };
};

var sort = function sort(dictOrd) {
  return sortBy(Data_Ord.compare(dictOrd));
};

var shift = $foreign.shiftImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var run = function run(st) {
  return Control_Bind.bind(Control_Monad_ST_Internal.bindST)(st)($foreign.unsafeFreeze)();
};

var push = function push(a) {
  return $foreign.pushAll([a]);
};

var pop = $foreign.popImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
var peek = $foreign.peekImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var modify = function modify(i) {
  return function (f) {
    return function (xs) {
      return function __do() {
        var entry = peek(i)(xs)();

        if (entry instanceof Data_Maybe.Just) {
          return $foreign.poke(i)(f(entry.value0))(xs)();
        }

        ;

        if (entry instanceof Data_Maybe.Nothing) {
          return false;
        }

        ;
        throw new Error("Failed pattern match at Data.Array.ST (line 188, column 3 - line 190, column 26): " + [entry.constructor.name]);
      };
    };
  };
};

module.exports = {
  run: run,
  withArray: withArray,
  peek: peek,
  modify: modify,
  pop: pop,
  push: push,
  shift: shift,
  unshift: unshift,
  sort: sort,
  sortBy: sortBy,
  sortWith: sortWith,
  empty: $foreign.empty,
  poke: $foreign.poke,
  pushAll: $foreign.pushAll,
  unshiftAll: $foreign.unshiftAll,
  splice: $foreign.splice,
  freeze: $foreign.freeze,
  thaw: $foreign.thaw,
  unsafeFreeze: $foreign.unsafeFreeze,
  unsafeThaw: $foreign.unsafeThaw,
  toAssocArray: $foreign.toAssocArray
};
},{"./foreign.js":"../output/Data.Array.ST/foreign.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad.ST.Internal/index.js":"../output/Control.Monad.ST.Internal/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js"}],"../output/Data.Array.ST.Iterator/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Monad_ST_Internal = require("../Control.Monad.ST.Internal/index.js");

var Data_Array_ST = require("../Data.Array.ST/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Iterator = function () {
  function Iterator(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Iterator.create = function (value0) {
    return function (value1) {
      return new Iterator(value0, value1);
    };
  };

  return Iterator;
}();

var peek = function peek(v) {
  return function __do() {
    var i = Control_Monad_ST_Internal.read(v.value1)();
    return v.value0(i);
  };
};

var next = function next(v) {
  return function __do() {
    var i = Control_Monad_ST_Internal.read(v.value1)();
    Control_Monad_ST_Internal.modify(function (v1) {
      return v1 + 1 | 0;
    })(v.value1)();
    return v.value0(i);
  };
};

var pushWhile = function pushWhile(p) {
  return function (iter) {
    return function (array) {
      return function __do() {
        var $$break = Control_Monad_ST_Internal["new"](false)();

        while (Data_Functor.map(Control_Monad_ST_Internal.functorST)(Data_HeytingAlgebra.not(Data_HeytingAlgebra.heytingAlgebraBoolean))(Control_Monad_ST_Internal.read($$break))()) {
          (function __do() {
            var mx = peek(iter)();

            if (mx instanceof Data_Maybe.Just && p(mx.value0)) {
              Data_Array_ST.push(mx.value0)(array)();
              return Data_Functor["void"](Control_Monad_ST_Internal.functorST)(next(iter))();
            }

            ;
            return Data_Functor["void"](Control_Monad_ST_Internal.functorST)(Control_Monad_ST_Internal.write(true)($$break))();
          })();
        }

        ;
        return {};
      };
    };
  };
};

var pushAll = pushWhile(Data_Function["const"](true));

var iterator = function iterator(f) {
  return Data_Functor.map(Control_Monad_ST_Internal.functorST)(Iterator.create(f))(Control_Monad_ST_Internal["new"](0));
};

var iterate = function iterate(iter) {
  return function (f) {
    return function __do() {
      var $$break = Control_Monad_ST_Internal["new"](false)();

      while (Data_Functor.map(Control_Monad_ST_Internal.functorST)(Data_HeytingAlgebra.not(Data_HeytingAlgebra.heytingAlgebraBoolean))(Control_Monad_ST_Internal.read($$break))()) {
        (function __do() {
          var mx = next(iter)();

          if (mx instanceof Data_Maybe.Just) {
            return f(mx.value0)();
          }

          ;

          if (mx instanceof Data_Maybe.Nothing) {
            return Data_Functor["void"](Control_Monad_ST_Internal.functorST)(Control_Monad_ST_Internal.write(true)($$break))();
          }

          ;
          throw new Error("Failed pattern match at Data.Array.ST.Iterator (line 42, column 5 - line 44, column 47): " + [mx.constructor.name]);
        })();
      }

      ;
      return {};
    };
  };
};

var exhausted = function () {
  var $13 = Data_Functor.map(Control_Monad_ST_Internal.functorST)(Data_Maybe.isNothing);
  return function ($14) {
    return $13(peek($14));
  };
}();

module.exports = {
  iterator: iterator,
  iterate: iterate,
  next: next,
  peek: peek,
  exhausted: exhausted,
  pushWhile: pushWhile,
  pushAll: pushAll
};
},{"../Control.Monad.ST.Internal/index.js":"../output/Control.Monad.ST.Internal/index.js","../Data.Array.ST/index.js":"../output/Data.Array.ST/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js"}],"../output/Data.Array/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Lazy = require("../Control.Lazy/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Control_Monad_ST_Internal = require("../Control.Monad.ST.Internal/index.js");

var Data_Array_ST = require("../Data.Array.ST/index.js");

var Data_Array_ST_Iterator = require("../Data.Array.ST.Iterator/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var zipWithA = function zipWithA(dictApplicative) {
  return function (f) {
    return function (xs) {
      return function (ys) {
        return Data_Traversable.sequence(Data_Traversable.traversableArray)(dictApplicative)($foreign.zipWith(f)(xs)(ys));
      };
    };
  };
};

var zip = $foreign.zipWith(Data_Tuple.Tuple.create);

var updateAtIndices = function updateAtIndices(dictFoldable) {
  return function (us) {
    return function (xs) {
      return Data_Array_ST.withArray(function (res) {
        return Data_Foldable.traverse_(Control_Monad_ST_Internal.applicativeST)(dictFoldable)(function (v) {
          return Data_Array_ST.poke(v.value0)(v.value1)(res);
        })(us);
      })(xs)();
    };
  };
};

var updateAt = $foreign["_updateAt"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var unsafeIndex = function unsafeIndex(dictPartial) {
  return $foreign.unsafeIndexImpl;
};

var uncons = $foreign["uncons'"](Data_Function["const"](Data_Maybe.Nothing.value))(function (x) {
  return function (xs) {
    return new Data_Maybe.Just({
      head: x,
      tail: xs
    });
  };
});

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  return function (xs) {
    var len = $foreign.length(xs);

    var f = function f(i) {
      if (i < len) {
        return new Data_Maybe.Just(new Data_Tuple.Tuple(unsafeIndex()(xs)(i), i + 1 | 0));
      }

      ;

      if (Data_Boolean.otherwise) {
        return Data_Maybe.Nothing.value;
      }

      ;
      throw new Error("Failed pattern match at Data.Array (line 143, column 3 - line 145, column 26): " + [i.constructor.name]);
    };

    return Data_Unfoldable.unfoldr(dictUnfoldable)(f)(0);
  };
};

var takeEnd = function takeEnd(n) {
  return function (xs) {
    return $foreign.drop($foreign.length(xs) - n | 0)(xs);
  };
};

var tail = $foreign["uncons'"](Data_Function["const"](Data_Maybe.Nothing.value))(function (v) {
  return function (xs) {
    return new Data_Maybe.Just(xs);
  };
});

var sortBy = function sortBy(comp) {
  return function (xs) {
    var comp$prime = function comp$prime(x) {
      return function (y) {
        var v = comp(x)(y);

        if (v instanceof Data_Ordering.GT) {
          return 1;
        }

        ;

        if (v instanceof Data_Ordering.EQ) {
          return 0;
        }

        ;

        if (v instanceof Data_Ordering.LT) {
          return -1 | 0;
        }

        ;
        throw new Error("Failed pattern match at Data.Array (line 702, column 15 - line 705, column 13): " + [v.constructor.name]);
      };
    };

    return $foreign.sortImpl(comp$prime)(xs);
  };
};

var sortWith = function sortWith(dictOrd) {
  return function (f) {
    return sortBy(Data_Ord.comparing(dictOrd)(f));
  };
};

var sort = function sort(dictOrd) {
  return function (xs) {
    return sortBy(Data_Ord.compare(dictOrd))(xs);
  };
};

var singleton = function singleton(a) {
  return [a];
};

var $$null = function $$null(xs) {
  return $foreign.length(xs) === 0;
};

var nubByEq = function nubByEq(eq) {
  return function (xs) {
    return function __do() {
      var arr = Data_Array_ST.empty();
      Control_Monad_ST_Internal.foreach(xs)(function (x) {
        return function __do() {
          var e = Data_Functor.map(Control_Monad_ST_Internal.functorST)(function () {
            var $84 = Data_HeytingAlgebra.not(Data_HeytingAlgebra.heytingAlgebraBoolean);
            var $85 = Data_Foldable.any(Data_Foldable.foldableArray)(Data_HeytingAlgebra.heytingAlgebraBoolean)(function (v) {
              return eq(v)(x);
            });
            return function ($86) {
              return $84($85($86));
            };
          }())(Data_Array_ST.unsafeFreeze(arr))();
          return Control_Applicative.when(Control_Monad_ST_Internal.applicativeST)(e)(Data_Functor["void"](Control_Monad_ST_Internal.functorST)(Data_Array_ST.push(x)(arr)))();
        };
      })();
      return Data_Array_ST.unsafeFreeze(arr)();
    }();
  };
};

var nubEq = function nubEq(dictEq) {
  return nubByEq(Data_Eq.eq(dictEq));
};

var modifyAtIndices = function modifyAtIndices(dictFoldable) {
  return function (is) {
    return function (f) {
      return function (xs) {
        return Data_Array_ST.withArray(function (res) {
          return Data_Foldable.traverse_(Control_Monad_ST_Internal.applicativeST)(dictFoldable)(function (i) {
            return Data_Array_ST.modify(i)(f)(res);
          })(is);
        })(xs)();
      };
    };
  };
};

var mapWithIndex = function mapWithIndex(f) {
  return function (xs) {
    return $foreign.zipWith(f)($foreign.range(0)($foreign.length(xs) - 1 | 0))(xs);
  };
};

var some = function some(dictAlternative) {
  return function (dictLazy) {
    return function (v) {
      return Control_Apply.apply(dictAlternative.Applicative0().Apply0())(Data_Functor.map(dictAlternative.Plus1().Alt0().Functor0())($foreign.cons)(v))(Control_Lazy.defer(dictLazy)(function (v1) {
        return many(dictAlternative)(dictLazy)(v);
      }));
    };
  };
};

var many = function many(dictAlternative) {
  return function (dictLazy) {
    return function (v) {
      return Control_Alt.alt(dictAlternative.Plus1().Alt0())(some(dictAlternative)(dictLazy)(v))(Control_Applicative.pure(dictAlternative.Applicative0())([]));
    };
  };
};

var insertAt = $foreign["_insertAt"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var init = function init(xs) {
  if ($$null(xs)) {
    return Data_Maybe.Nothing.value;
  }

  ;

  if (Data_Boolean.otherwise) {
    return new Data_Maybe.Just($foreign.slice(0)($foreign.length(xs) - 1 | 0)(xs));
  }

  ;
  throw new Error("Failed pattern match at Data.Array (line 323, column 1 - line 323, column 45): " + [xs.constructor.name]);
};

var index = $foreign.indexImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var last = function last(xs) {
  return index(xs)($foreign.length(xs) - 1 | 0);
};

var unsnoc = function unsnoc(xs) {
  return Control_Apply.apply(Data_Maybe.applyMaybe)(Data_Functor.map(Data_Maybe.functorMaybe)(function (v) {
    return function (v1) {
      return {
        init: v,
        last: v1
      };
    };
  })(init(xs)))(last(xs));
};

var modifyAt = function modifyAt(i) {
  return function (f) {
    return function (xs) {
      var go = function go(x) {
        return updateAt(i)(f(x))(xs);
      };

      return Data_Maybe.maybe(Data_Maybe.Nothing.value)(go)(index(xs)(i));
    };
  };
};

var span = function span(p) {
  return function (arr) {
    var go = function go($copy_i) {
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(i) {
        var v = index(arr)(i);

        if (v instanceof Data_Maybe.Just) {
          var $60 = p(v.value0);

          if ($60) {
            $copy_i = i + 1 | 0;
            return;
          }

          ;
          $tco_done = true;
          return new Data_Maybe.Just(i);
        }

        ;

        if (v instanceof Data_Maybe.Nothing) {
          $tco_done = true;
          return Data_Maybe.Nothing.value;
        }

        ;
        throw new Error("Failed pattern match at Data.Array (line 834, column 5 - line 836, column 25): " + [v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($copy_i);
      }

      ;
      return $tco_result;
    };

    var breakIndex = go(0);

    if (breakIndex instanceof Data_Maybe.Just && breakIndex.value0 === 0) {
      return {
        init: [],
        rest: arr
      };
    }

    ;

    if (breakIndex instanceof Data_Maybe.Just) {
      return {
        init: $foreign.slice(0)(breakIndex.value0)(arr),
        rest: $foreign.slice(breakIndex.value0)($foreign.length(arr))(arr)
      };
    }

    ;

    if (breakIndex instanceof Data_Maybe.Nothing) {
      return {
        init: arr,
        rest: []
      };
    }

    ;
    throw new Error("Failed pattern match at Data.Array (line 821, column 3 - line 827, column 30): " + [breakIndex.constructor.name]);
  };
};

var takeWhile = function takeWhile(p) {
  return function (xs) {
    return span(p)(xs).init;
  };
};

var unzip = function unzip(xs) {
  return function __do() {
    var fsts = Data_Array_ST.empty();
    var snds = Data_Array_ST.empty();
    var iter = Data_Array_ST_Iterator.iterator(function (v) {
      return index(xs)(v);
    })();
    Data_Array_ST_Iterator.iterate(iter)(function (v) {
      return function __do() {
        Data_Functor["void"](Control_Monad_ST_Internal.functorST)(Data_Array_ST.push(v.value0)(fsts))();
        return Data_Functor["void"](Control_Monad_ST_Internal.functorST)(Data_Array_ST.push(v.value1)(snds))();
      };
    })();
    var fsts$prime = Data_Array_ST.unsafeFreeze(fsts)();
    var snds$prime = Data_Array_ST.unsafeFreeze(snds)();
    return new Data_Tuple.Tuple(fsts$prime, snds$prime);
  }();
};

var head = function head(xs) {
  return index(xs)(0);
};

var nubBy = function nubBy(comp) {
  return function (xs) {
    var indexedAndSorted = sortBy(function (x) {
      return function (y) {
        return comp(Data_Tuple.snd(x))(Data_Tuple.snd(y));
      };
    })(mapWithIndex(Data_Tuple.Tuple.create)(xs));
    var v = head(indexedAndSorted);

    if (v instanceof Data_Maybe.Nothing) {
      return [];
    }

    ;

    if (v instanceof Data_Maybe.Just) {
      return Data_Functor.map(Data_Functor.functorArray)(Data_Tuple.snd)(sortWith(Data_Ord.ordInt)(Data_Tuple.fst)(function __do() {
        var result = Data_Array_ST.unsafeThaw(singleton(v.value0))();
        Control_Monad_ST_Internal.foreach(indexedAndSorted)(function (v1) {
          return function __do() {
            var lst = Data_Functor.map(Control_Monad_ST_Internal.functorST)(function () {
              var $87 = function (dictPartial) {
                var $89 = Data_Maybe.fromJust();
                return function ($90) {
                  return $89(last($90));
                };
              }();

              return function ($88) {
                return Data_Tuple.snd($87($88));
              };
            }())(Data_Array_ST.unsafeFreeze(result))();
            return Control_Applicative.when(Control_Monad_ST_Internal.applicativeST)(Data_Eq.notEq(Data_Ordering.eqOrdering)(comp(lst)(v1.value1))(Data_Ordering.EQ.value))(Data_Functor["void"](Control_Monad_ST_Internal.functorST)(Data_Array_ST.push(v1)(result)))();
          };
        })();
        return Data_Array_ST.unsafeFreeze(result)();
      }()));
    }

    ;
    throw new Error("Failed pattern match at Data.Array (line 903, column 17 - line 911, column 29): " + [v.constructor.name]);
  };
};

var nub = function nub(dictOrd) {
  return nubBy(Data_Ord.compare(dictOrd));
};

var groupBy = function groupBy(op) {
  return function (xs) {
    return function __do() {
      var result = Data_Array_ST.empty();
      var iter = Data_Array_ST_Iterator.iterator(function (v) {
        return index(xs)(v);
      })();
      Data_Array_ST_Iterator.iterate(iter)(function (x) {
        return Data_Functor["void"](Control_Monad_ST_Internal.functorST)(function __do() {
          var sub = Data_Array_ST.empty();
          Data_Array_ST.push(x)(sub)();
          Data_Array_ST_Iterator.pushWhile(op(x))(iter)(sub)();
          var grp = Data_Array_ST.unsafeFreeze(sub)();
          return Data_Array_ST.push(grp)(result)();
        });
      })();
      return Data_Array_ST.unsafeFreeze(result)();
    }();
  };
};

var group = function group(dictEq) {
  return function (xs) {
    return groupBy(Data_Eq.eq(dictEq))(xs);
  };
};

var group$prime = function group$prime(dictOrd) {
  var $91 = group(dictOrd.Eq0());
  var $92 = sort(dictOrd);
  return function ($93) {
    return $91($92($93));
  };
};

var fromFoldable = function fromFoldable(dictFoldable) {
  return $foreign.fromFoldableImpl(Data_Foldable.foldr(dictFoldable));
};

var foldRecM = function foldRecM(dictMonadRec) {
  return function (f) {
    return function (a) {
      return function (array) {
        var go = function go(res) {
          return function (i) {
            if (i >= $foreign.length(array)) {
              return Control_Applicative.pure(dictMonadRec.Monad0().Applicative0())(new Control_Monad_Rec_Class.Done(res));
            }

            ;

            if (Data_Boolean.otherwise) {
              return Control_Bind.bind(dictMonadRec.Monad0().Bind1())(f(res)(unsafeIndex()(array)(i)))(function (res$prime) {
                return Control_Applicative.pure(dictMonadRec.Monad0().Applicative0())(new Control_Monad_Rec_Class.Loop({
                  a: res$prime,
                  b: i + 1 | 0
                }));
              });
            }

            ;
            throw new Error("Failed pattern match at Data.Array (line 1101, column 3 - line 1105, column 42): " + [res.constructor.name, i.constructor.name]);
          };
        };

        return Control_Monad_Rec_Class.tailRecM2(dictMonadRec)(go)(a)(0);
      };
    };
  };
};

var foldM = function foldM(dictMonad) {
  return function (f) {
    return function (a) {
      return $foreign["uncons'"](function (v) {
        return Control_Applicative.pure(dictMonad.Applicative0())(a);
      })(function (b) {
        return function (bs) {
          return Control_Bind.bind(dictMonad.Bind1())(f(a)(b))(function (a$prime) {
            return foldM(dictMonad)(f)(a$prime)(bs);
          });
        };
      });
    };
  };
};

var findLastIndex = $foreign.findLastIndexImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var insertBy = function insertBy(cmp) {
  return function (x) {
    return function (ys) {
      var i = Data_Maybe.maybe(0)(function (v) {
        return v + 1 | 0;
      })(findLastIndex(function (y) {
        return Data_Eq.eq(Data_Ordering.eqOrdering)(cmp(x)(y))(Data_Ordering.GT.value);
      })(ys));
      return Data_Maybe.fromJust()(insertAt(i)(x)(ys));
    };
  };
};

var insert = function insert(dictOrd) {
  return insertBy(Data_Ord.compare(dictOrd));
};

var findIndex = $foreign.findIndexImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var intersectBy = function intersectBy(eq) {
  return function (xs) {
    return function (ys) {
      return $foreign.filter(function (x) {
        return Data_Maybe.isJust(findIndex(eq(x))(ys));
      })(xs);
    };
  };
};

var intersect = function intersect(dictEq) {
  return intersectBy(Data_Eq.eq(dictEq));
};

var elemLastIndex = function elemLastIndex(dictEq) {
  return function (x) {
    return findLastIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var elemIndex = function elemIndex(dictEq) {
  return function (x) {
    return findIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var dropWhile = function dropWhile(p) {
  return function (xs) {
    return span(p)(xs).rest;
  };
};

var dropEnd = function dropEnd(n) {
  return function (xs) {
    return $foreign.take($foreign.length(xs) - n | 0)(xs);
  };
};

var deleteAt = $foreign["_deleteAt"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);

var deleteBy = function deleteBy(v) {
  return function (v1) {
    return function (v2) {
      if (v2.length === 0) {
        return [];
      }

      ;
      return Data_Maybe.maybe(v2)(function (i) {
        return Data_Maybe.fromJust()(deleteAt(i)(v2));
      })(findIndex(v(v1))(v2));
    };
  };
};

var unionBy = function unionBy(eq) {
  return function (xs) {
    return function (ys) {
      return Data_Semigroup.append(Data_Semigroup.semigroupArray)(xs)(Data_Foldable.foldl(Data_Foldable.foldableArray)(Data_Function.flip(deleteBy(eq)))(nubByEq(eq)(ys))(xs));
    };
  };
};

var union = function union(dictEq) {
  return unionBy(Data_Eq.eq(dictEq));
};

var $$delete = function $$delete(dictEq) {
  return deleteBy(Data_Eq.eq(dictEq));
};

var difference = function difference(dictEq) {
  return Data_Foldable.foldr(Data_Foldable.foldableArray)($$delete(dictEq));
};

var concatMap = Data_Function.flip(Control_Bind.bind(Control_Bind.bindArray));

var mapMaybe = function mapMaybe(f) {
  return concatMap(function () {
    var $94 = Data_Maybe.maybe([])(singleton);
    return function ($95) {
      return $94(f($95));
    };
  }());
};

var filterA = function filterA(dictApplicative) {
  return function (p) {
    var $96 = Data_Functor.map(dictApplicative.Apply0().Functor0())(mapMaybe(function (v) {
      if (v.value1) {
        return new Data_Maybe.Just(v.value0);
      }

      ;
      return Data_Maybe.Nothing.value;
    }));
    var $97 = Data_Traversable.traverse(Data_Traversable.traversableArray)(dictApplicative)(function (x) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Tuple.Tuple.create(x))(p(x));
    });
    return function ($98) {
      return $96($97($98));
    };
  };
};

var catMaybes = mapMaybe(Control_Category.identity(Control_Category.categoryFn));

var alterAt = function alterAt(i) {
  return function (f) {
    return function (xs) {
      var go = function go(x) {
        var v = f(x);

        if (v instanceof Data_Maybe.Nothing) {
          return deleteAt(i)(xs);
        }

        ;

        if (v instanceof Data_Maybe.Just) {
          return updateAt(i)(v.value0)(xs);
        }

        ;
        throw new Error("Failed pattern match at Data.Array (line 544, column 10 - line 546, column 32): " + [v.constructor.name]);
      };

      return Data_Maybe.maybe(Data_Maybe.Nothing.value)(go)(index(xs)(i));
    };
  };
};

module.exports = {
  fromFoldable: fromFoldable,
  toUnfoldable: toUnfoldable,
  singleton: singleton,
  some: some,
  many: many,
  "null": $$null,
  insert: insert,
  insertBy: insertBy,
  head: head,
  last: last,
  tail: tail,
  init: init,
  uncons: uncons,
  unsnoc: unsnoc,
  index: index,
  elemIndex: elemIndex,
  elemLastIndex: elemLastIndex,
  findIndex: findIndex,
  findLastIndex: findLastIndex,
  insertAt: insertAt,
  deleteAt: deleteAt,
  updateAt: updateAt,
  updateAtIndices: updateAtIndices,
  modifyAt: modifyAt,
  modifyAtIndices: modifyAtIndices,
  alterAt: alterAt,
  concatMap: concatMap,
  filterA: filterA,
  mapMaybe: mapMaybe,
  catMaybes: catMaybes,
  mapWithIndex: mapWithIndex,
  sort: sort,
  sortBy: sortBy,
  sortWith: sortWith,
  takeEnd: takeEnd,
  takeWhile: takeWhile,
  dropEnd: dropEnd,
  dropWhile: dropWhile,
  span: span,
  group: group,
  "group'": group$prime,
  groupBy: groupBy,
  nub: nub,
  nubEq: nubEq,
  nubBy: nubBy,
  nubByEq: nubByEq,
  union: union,
  unionBy: unionBy,
  "delete": $$delete,
  deleteBy: deleteBy,
  difference: difference,
  intersect: intersect,
  intersectBy: intersectBy,
  zipWithA: zipWithA,
  zip: zip,
  unzip: unzip,
  foldM: foldM,
  foldRecM: foldRecM,
  unsafeIndex: unsafeIndex,
  range: $foreign.range,
  replicate: $foreign.replicate,
  length: $foreign.length,
  cons: $foreign.cons,
  snoc: $foreign.snoc,
  reverse: $foreign.reverse,
  concat: $foreign.concat,
  filter: $foreign.filter,
  partition: $foreign.partition,
  slice: $foreign.slice,
  take: $foreign.take,
  drop: $foreign.drop,
  zipWith: $foreign.zipWith
};
},{"./foreign.js":"../output/Data.Array/foreign.js","../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Lazy/index.js":"../output/Control.Lazy/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Control.Monad.ST.Internal/index.js":"../output/Control.Monad.ST.Internal/index.js","../Data.Array.ST/index.js":"../output/Data.Array.ST/index.js","../Data.Array.ST.Iterator/index.js":"../output/Data.Array.ST.Iterator/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js"}],"../output/Foreign.Generic.Internal/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Foreign = require("../Foreign/index.js");

var isObject = function isObject(v) {
  return Foreign.tagOf(v) === "Object";
};

var readObject = function readObject(value) {
  if (isObject(value)) {
    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Foreign.unsafeFromForeign(value));
  }

  ;

  if (Data_Boolean.otherwise) {
    return Foreign.fail(new Foreign.TypeMismatch("Object", Foreign.tagOf(value)));
  }

  ;
  throw new Error("Failed pattern match at Foreign.Generic.Internal (line 13, column 1 - line 13, column 44): " + [value.constructor.name]);
};

module.exports = {
  isObject: isObject,
  readObject: readObject
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Foreign/index.js":"../output/Foreign/index.js"}],"../output/Foreign.Index/foreign.js":[function(require,module,exports) {
"use strict";

exports.unsafeReadPropImpl = function (f, s, key, value) {
  return value == null ? f : s(value[key]);
};

exports.unsafeHasOwnProperty = function (prop, value) {
  return Object.prototype.hasOwnProperty.call(value, prop);
};

exports.unsafeHasProperty = function (prop, value) {
  return prop in value;
};
},{}],"../output/Foreign.Index/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Foreign = require("../Foreign/index.js");

var Indexable = function Indexable(ix) {
  this.ix = ix;
};

var Index = function Index(errorAt, hasOwnProperty, hasProperty, index) {
  this.errorAt = errorAt;
  this.hasOwnProperty = hasOwnProperty;
  this.hasProperty = hasProperty;
  this.index = index;
};

var unsafeReadProp = function unsafeReadProp(k) {
  return function (value) {
    return $foreign.unsafeReadPropImpl(Foreign.fail(new Foreign.TypeMismatch("object", Foreign.typeOf(value))), Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity)), k, value);
  };
};

var readProp = unsafeReadProp;
var readIndex = unsafeReadProp;

var ix = function ix(dict) {
  return dict.ix;
};

var index = function index(dict) {
  return dict.index;
};

var indexableExceptT = new Indexable(function (dictIndex) {
  return function (f) {
    return function (i) {
      return Control_Bind.bindFlipped(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Data_Function.flip(index(dictIndex))(i))(f);
    };
  };
});
var indexableForeign = new Indexable(function (dictIndex) {
  return index(dictIndex);
});

var hasPropertyImpl = function hasPropertyImpl(v) {
  return function (value) {
    if (Foreign.isNull(value)) {
      return false;
    }

    ;

    if (Foreign.isUndefined(value)) {
      return false;
    }

    ;

    if (Foreign.typeOf(value) === "object" || Foreign.typeOf(value) === "function") {
      return $foreign.unsafeHasProperty(v, value);
    }

    ;
    return false;
  };
};

var hasProperty = function hasProperty(dict) {
  return dict.hasProperty;
};

var hasOwnPropertyImpl = function hasOwnPropertyImpl(v) {
  return function (value) {
    if (Foreign.isNull(value)) {
      return false;
    }

    ;

    if (Foreign.isUndefined(value)) {
      return false;
    }

    ;

    if (Foreign.typeOf(value) === "object" || Foreign.typeOf(value) === "function") {
      return $foreign.unsafeHasOwnProperty(v, value);
    }

    ;
    return false;
  };
};

var indexInt = new Index(Foreign.ErrorAtIndex.create, hasOwnPropertyImpl, hasPropertyImpl, Data_Function.flip(readIndex));
var indexString = new Index(Foreign.ErrorAtProperty.create, hasOwnPropertyImpl, hasPropertyImpl, Data_Function.flip(readProp));

var hasOwnProperty = function hasOwnProperty(dict) {
  return dict.hasOwnProperty;
};

var errorAt = function errorAt(dict) {
  return dict.errorAt;
};

module.exports = {
  Index: Index,
  Indexable: Indexable,
  readProp: readProp,
  readIndex: readIndex,
  ix: ix,
  index: index,
  hasProperty: hasProperty,
  hasOwnProperty: hasOwnProperty,
  errorAt: errorAt,
  indexString: indexString,
  indexInt: indexInt,
  indexableForeign: indexableForeign,
  indexableExceptT: indexableExceptT
};
},{"./foreign.js":"../output/Foreign.Index/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Foreign/index.js":"../output/Foreign/index.js"}],"../output/Foreign.NullOrUndefined/foreign.js":[function(require,module,exports) {
exports['null'] = null;
exports['undefined'] = undefined;
},{}],"../output/Foreign.NullOrUndefined/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Foreign = require("../Foreign/index.js");

var readNullOrUndefined = function readNullOrUndefined(v) {
  return function (value) {
    if (Foreign.isNull(value) || Foreign.isUndefined(value)) {
      return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Maybe.Nothing.value);
    }

    ;
    return Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Data_Maybe.Just.create)(v(value));
  };
};

module.exports = {
  readNullOrUndefined: readNullOrUndefined,
  "undefined": $foreign["undefined"],
  "null": $foreign["null"]
};
},{"./foreign.js":"../output/Foreign.NullOrUndefined/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Foreign/index.js":"../output/Foreign/index.js"}],"../output/Foreign.Object/foreign.js":[function(require,module,exports) {
"use strict";

exports._copyST = function (m) {
  return function () {
    var r = {};

    for (var k in m) {
      if (hasOwnProperty.call(m, k)) {
        r[k] = m[k];
      }
    }

    return r;
  };
};

exports.empty = {};

exports.runST = function (f) {
  return f();
};

exports._fmapObject = function (m0, f) {
  var m = {};

  for (var k in m0) {
    if (hasOwnProperty.call(m0, k)) {
      m[k] = f(m0[k]);
    }
  }

  return m;
};

exports._mapWithKey = function (m0, f) {
  var m = {};

  for (var k in m0) {
    if (hasOwnProperty.call(m0, k)) {
      m[k] = f(k)(m0[k]);
    }
  }

  return m;
};

exports._foldM = function (bind) {
  return function (f) {
    return function (mz) {
      return function (m) {
        var acc = mz;

        function g(k) {
          return function (z) {
            return f(z)(k)(m[k]);
          };
        }

        for (var k in m) {
          if (hasOwnProperty.call(m, k)) {
            acc = bind(acc)(g(k));
          }
        }

        return acc;
      };
    };
  };
};

exports._foldSCObject = function (m, z, f, fromMaybe) {
  var acc = z;

  for (var k in m) {
    if (hasOwnProperty.call(m, k)) {
      var maybeR = f(acc)(k)(m[k]);
      var r = fromMaybe(null)(maybeR);
      if (r === null) return acc;else acc = r;
    }
  }

  return acc;
};

exports.all = function (f) {
  return function (m) {
    for (var k in m) {
      if (hasOwnProperty.call(m, k) && !f(k)(m[k])) return false;
    }

    return true;
  };
};

exports.size = function (m) {
  var s = 0;

  for (var k in m) {
    if (hasOwnProperty.call(m, k)) {
      ++s;
    }
  }

  return s;
};

exports._lookup = function (no, yes, k, m) {
  return k in m ? yes(m[k]) : no;
};

exports._lookupST = function (no, yes, k, m) {
  return function () {
    return k in m ? yes(m[k]) : no;
  };
};

function toArrayWithKey(f) {
  return function (m) {
    var r = [];

    for (var k in m) {
      if (hasOwnProperty.call(m, k)) {
        r.push(f(k)(m[k]));
      }
    }

    return r;
  };
}

exports.toArrayWithKey = toArrayWithKey;
exports.keys = Object.keys || toArrayWithKey(function (k) {
  return function () {
    return k;
  };
});
},{}],"../output/Data.Function.Uncurried/foreign.js":[function(require,module,exports) {
"use strict"; // module Data.Function.Uncurried

exports.mkFn0 = function (fn) {
  return function () {
    return fn({});
  };
};

exports.mkFn2 = function (fn) {
  /* jshint maxparams: 2 */
  return function (a, b) {
    return fn(a)(b);
  };
};

exports.mkFn3 = function (fn) {
  /* jshint maxparams: 3 */
  return function (a, b, c) {
    return fn(a)(b)(c);
  };
};

exports.mkFn4 = function (fn) {
  /* jshint maxparams: 4 */
  return function (a, b, c, d) {
    return fn(a)(b)(c)(d);
  };
};

exports.mkFn5 = function (fn) {
  /* jshint maxparams: 5 */
  return function (a, b, c, d, e) {
    return fn(a)(b)(c)(d)(e);
  };
};

exports.mkFn6 = function (fn) {
  /* jshint maxparams: 6 */
  return function (a, b, c, d, e, f) {
    return fn(a)(b)(c)(d)(e)(f);
  };
};

exports.mkFn7 = function (fn) {
  /* jshint maxparams: 7 */
  return function (a, b, c, d, e, f, g) {
    return fn(a)(b)(c)(d)(e)(f)(g);
  };
};

exports.mkFn8 = function (fn) {
  /* jshint maxparams: 8 */
  return function (a, b, c, d, e, f, g, h) {
    return fn(a)(b)(c)(d)(e)(f)(g)(h);
  };
};

exports.mkFn9 = function (fn) {
  /* jshint maxparams: 9 */
  return function (a, b, c, d, e, f, g, h, i) {
    return fn(a)(b)(c)(d)(e)(f)(g)(h)(i);
  };
};

exports.mkFn10 = function (fn) {
  /* jshint maxparams: 10 */
  return function (a, b, c, d, e, f, g, h, i, j) {
    return fn(a)(b)(c)(d)(e)(f)(g)(h)(i)(j);
  };
};

exports.runFn0 = function (fn) {
  return fn();
};

exports.runFn2 = function (fn) {
  return function (a) {
    return function (b) {
      return fn(a, b);
    };
  };
};

exports.runFn3 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return fn(a, b, c);
      };
    };
  };
};

exports.runFn4 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return fn(a, b, c, d);
        };
      };
    };
  };
};

exports.runFn5 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return fn(a, b, c, d, e);
          };
        };
      };
    };
  };
};

exports.runFn6 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return fn(a, b, c, d, e, f);
            };
          };
        };
      };
    };
  };
};

exports.runFn7 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return fn(a, b, c, d, e, f, g);
              };
            };
          };
        };
      };
    };
  };
};

exports.runFn8 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return function (h) {
                  return fn(a, b, c, d, e, f, g, h);
                };
              };
            };
          };
        };
      };
    };
  };
};

exports.runFn9 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return function (h) {
                  return function (i) {
                    return fn(a, b, c, d, e, f, g, h, i);
                  };
                };
              };
            };
          };
        };
      };
    };
  };
};

exports.runFn10 = function (fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return function (h) {
                  return function (i) {
                    return function (j) {
                      return fn(a, b, c, d, e, f, g, h, i, j);
                    };
                  };
                };
              };
            };
          };
        };
      };
    };
  };
};
},{}],"../output/Data.Function.Uncurried/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var runFn1 = function runFn1(f) {
  return f;
};

var mkFn1 = function mkFn1(f) {
  return f;
};

module.exports = {
  mkFn1: mkFn1,
  runFn1: runFn1,
  mkFn0: $foreign.mkFn0,
  mkFn2: $foreign.mkFn2,
  mkFn3: $foreign.mkFn3,
  mkFn4: $foreign.mkFn4,
  mkFn5: $foreign.mkFn5,
  mkFn6: $foreign.mkFn6,
  mkFn7: $foreign.mkFn7,
  mkFn8: $foreign.mkFn8,
  mkFn9: $foreign.mkFn9,
  mkFn10: $foreign.mkFn10,
  runFn0: $foreign.runFn0,
  runFn2: $foreign.runFn2,
  runFn3: $foreign.runFn3,
  runFn4: $foreign.runFn4,
  runFn5: $foreign.runFn5,
  runFn6: $foreign.runFn6,
  runFn7: $foreign.runFn7,
  runFn8: $foreign.runFn8,
  runFn9: $foreign.runFn9,
  runFn10: $foreign.runFn10
};
},{"./foreign.js":"../output/Data.Function.Uncurried/foreign.js"}],"../output/Foreign.Object.ST/foreign.js":[function(require,module,exports) {
"use strict";

exports["new"] = function () {
  return {};
};

exports.peekImpl = function (just) {
  return function (nothing) {
    return function (k) {
      return function (m) {
        return function () {
          return {}.hasOwnProperty.call(m, k) ? just(m[k]) : nothing;
        };
      };
    };
  };
};

exports.poke = function (k) {
  return function (v) {
    return function (m) {
      return function () {
        m[k] = v;
        return m;
      };
    };
  };
};

exports["delete"] = function (k) {
  return function (m) {
    return function () {
      delete m[k];
      return m;
    };
  };
};
},{}],"../output/Foreign.Object.ST/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var peek = $foreign.peekImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);
module.exports = {
  peek: peek,
  "new": $foreign["new"],
  poke: $foreign.poke,
  "delete": $foreign["delete"]
};
},{"./foreign.js":"../output/Foreign.Object.ST/foreign.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js"}],"../output/Unsafe.Coerce/foreign.js":[function(require,module,exports) {
"use strict"; // module Unsafe.Coerce

exports.unsafeCoerce = function (x) {
  return x;
};
},{}],"../output/Unsafe.Coerce/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

module.exports = {
  unsafeCoerce: $foreign.unsafeCoerce
};
},{"./foreign.js":"../output/Unsafe.Coerce/foreign.js"}],"../output/Foreign.Object/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Monad_ST_Internal = require("../Control.Monad.ST.Internal/index.js");

var Data_Array = require("../Data.Array/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Function_Uncurried = require("../Data.Function.Uncurried/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Foreign_Object_ST = require("../Foreign.Object.ST/index.js");

var Unsafe_Coerce = require("../Unsafe.Coerce/index.js");

var values = $foreign.toArrayWithKey(function (v) {
  return function (v1) {
    return v1;
  };
});

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  var $36 = Data_Array.toUnfoldable(dictUnfoldable);
  var $37 = $foreign.toArrayWithKey(Data_Tuple.Tuple.create);
  return function ($38) {
    return $36($37($38));
  };
};

var toAscUnfoldable = function toAscUnfoldable(dictUnfoldable) {
  var $39 = Data_Array.toUnfoldable(dictUnfoldable);
  var $40 = Data_Array.sortWith(Data_Ord.ordString)(Data_Tuple.fst);
  var $41 = $foreign.toArrayWithKey(Data_Tuple.Tuple.create);
  return function ($42) {
    return $39($40($41($42)));
  };
};

var toAscArray = toAscUnfoldable(Data_Unfoldable.unfoldableArray);
var toArray = $foreign.toArrayWithKey(Data_Tuple.Tuple.create);
var thawST = $foreign["_copyST"];

var singleton = function singleton(k) {
  return function (v) {
    return $foreign.runST(Control_Bind.bindFlipped(Control_Monad_ST_Internal.bindST)(Foreign_Object_ST.poke(k)(v))(Foreign_Object_ST["new"]));
  };
};

var showObject = function showObject(dictShow) {
  return new Data_Show.Show(function (m) {
    return "(fromFoldable " + (Data_Show.show(Data_Show.showArray(Data_Tuple.showTuple(Data_Show.showString)(dictShow)))(toArray(m)) + ")");
  });
};

var mutate = function mutate(f) {
  return function (m) {
    return $foreign.runST(function __do() {
      var s = thawST(m)();
      f(s)();
      return s;
    });
  };
};

var member = Data_Function_Uncurried.runFn4($foreign["_lookup"])(false)(Data_Function["const"](true));

var mapWithKey = function mapWithKey(f) {
  return function (m) {
    return $foreign["_mapWithKey"](m, f);
  };
};

var lookup = Data_Function_Uncurried.runFn4($foreign["_lookup"])(Data_Maybe.Nothing.value)(Data_Maybe.Just.create);

var isSubmap = function isSubmap(dictEq) {
  return function (m1) {
    return function (m2) {
      var f = function f(k) {
        return function (v) {
          return $foreign["_lookup"](false, Data_Eq.eq(dictEq)(v), k, m2);
        };
      };

      return $foreign.all(f)(m1);
    };
  };
};

var isEmpty = $foreign.all(function (v) {
  return function (v1) {
    return false;
  };
});

var insert = function insert(k) {
  return function (v) {
    return mutate(Foreign_Object_ST.poke(k)(v));
  };
};

var functorObject = new Data_Functor.Functor(function (f) {
  return function (m) {
    return $foreign["_fmapObject"](m, f);
  };
});
var functorWithIndexObject = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorObject;
}, mapWithKey);

var fromHomogeneous = function fromHomogeneous(dictHomogeneous) {
  return Unsafe_Coerce.unsafeCoerce;
};

var fromFoldableWith = function fromFoldableWith(dictFoldable) {
  return function (f) {
    return function (l) {
      return $foreign.runST(function __do() {
        var s = Foreign_Object_ST["new"]();
        Data_Foldable.for_(Control_Monad_ST_Internal.applicativeST)(dictFoldable)(l)(function (v) {
          return function __do() {
            var v$prime = $foreign["_lookupST"](v.value1, f(v.value1), v.value0, s)();
            return Foreign_Object_ST.poke(v.value0)(v$prime)(s)();
          };
        })();
        return s;
      });
    };
  };
};

var fromFoldable = function fromFoldable(dictFoldable) {
  return function (l) {
    return $foreign.runST(function __do() {
      var s = Foreign_Object_ST["new"]();
      Control_Monad_ST_Internal.foreach(Data_Array.fromFoldable(dictFoldable)(l))(function (v) {
        return Data_Functor["void"](Control_Monad_ST_Internal.functorST)(Foreign_Object_ST.poke(v.value0)(v.value1)(s));
      })();
      return s;
    });
  };
};

var freezeST = $foreign["_copyST"];

var foldMaybe = function foldMaybe(f) {
  return function (z) {
    return function (m) {
      return $foreign["_foldSCObject"](m, z, f, Data_Maybe.fromMaybe);
    };
  };
};

var foldM = function foldM(dictMonad) {
  return function (f) {
    return function (z) {
      return $foreign["_foldM"](Control_Bind.bind(dictMonad.Bind1()))(f)(Control_Applicative.pure(dictMonad.Applicative0())(z));
    };
  };
};

var semigroupObject = function semigroupObject(dictSemigroup) {
  return new Data_Semigroup.Semigroup(function (m1) {
    return function (m2) {
      return mutate(function (s1) {
        return foldM(Control_Monad_ST_Internal.monadST)(function (s2) {
          return function (k) {
            return function (v2) {
              return Foreign_Object_ST.poke(k)($foreign["_lookup"](v2, function (v1) {
                return Data_Semigroup.append(dictSemigroup)(v1)(v2);
              }, k, m2))(s2);
            };
          };
        })(s1)(m1);
      })(m2);
    };
  });
};

var monoidObject = function monoidObject(dictSemigroup) {
  return new Data_Monoid.Monoid(function () {
    return semigroupObject(dictSemigroup);
  }, $foreign.empty);
};

var union = function union(m) {
  return mutate(function (s) {
    return foldM(Control_Monad_ST_Internal.monadST)(function (s$prime) {
      return function (k) {
        return function (v) {
          return Foreign_Object_ST.poke(k)(v)(s$prime);
        };
      };
    })(s)(m);
  });
};

var unions = function unions(dictFoldable) {
  return Data_Foldable.foldl(dictFoldable)(union)($foreign.empty);
};

var fold = $foreign["_foldM"](Data_Function.applyFlipped);

var foldMap = function foldMap(dictMonoid) {
  return function (f) {
    return fold(function (acc) {
      return function (k) {
        return function (v) {
          return Data_Semigroup.append(dictMonoid.Semigroup0())(acc)(f(k)(v));
        };
      };
    })(Data_Monoid.mempty(dictMonoid));
  };
};

var foldableObject = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return foldMap(dictMonoid)(Data_Function["const"](f));
  };
}, function (f) {
  return fold(function (z) {
    return function (v) {
      return f(z);
    };
  });
}, function (f) {
  return function (z) {
    return function (m) {
      return Data_Foldable.foldr(Data_Foldable.foldableArray)(f)(z)(values(m));
    };
  };
});
var foldableWithIndexObject = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableObject;
}, function (dictMonoid) {
  return foldMap(dictMonoid);
}, function (f) {
  return fold(Data_Function.flip(f));
}, function (f) {
  return function (z) {
    return function (m) {
      return Data_Foldable.foldr(Data_Foldable.foldableArray)(Data_Tuple.uncurry(f))(z)($foreign.toArrayWithKey(Data_Tuple.Tuple.create)(m));
    };
  };
});
var traversableWithIndexObject = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexObject;
}, function () {
  return functorWithIndexObject;
}, function () {
  return traversableObject;
}, function (dictApplicative) {
  return function (f) {
    return function (ms) {
      return fold(function (acc) {
        return function (k) {
          return function (v) {
            return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Function.flip(insert(k)))(acc))(f(k)(v));
          };
        };
      })(Control_Applicative.pure(dictApplicative)($foreign.empty))(ms);
    };
  };
});
var traversableObject = new Data_Traversable.Traversable(function () {
  return foldableObject;
}, function () {
  return functorObject;
}, function (dictApplicative) {
  return Data_Traversable.traverse(traversableObject)(dictApplicative)(Control_Category.identity(Control_Category.categoryFn));
}, function (dictApplicative) {
  var $43 = Data_TraversableWithIndex.traverseWithIndex(traversableWithIndexObject)(dictApplicative);
  return function ($44) {
    return $43(Data_Function["const"]($44));
  };
});

var filterWithKey = function filterWithKey(predicate) {
  return function (m) {
    var go = function () {
      var step = function step(acc) {
        return function (k) {
          return function (v) {
            var $33 = predicate(k)(v);

            if ($33) {
              return Foreign_Object_ST.poke(k)(v)(acc);
            }

            ;
            return Control_Applicative.pure(Control_Monad_ST_Internal.applicativeST)(acc);
          };
        };
      };

      return function __do() {
        var m$prime = Foreign_Object_ST["new"]();
        return foldM(Control_Monad_ST_Internal.monadST)(step)(m$prime)(m)();
      };
    }();

    return $foreign.runST(go);
  };
};

var filterKeys = function filterKeys(predicate) {
  return filterWithKey(function ($45) {
    return Data_Function["const"](predicate($45));
  });
};

var filter = function filter(predicate) {
  return filterWithKey(Data_Function["const"](predicate));
};

var eqObject = function eqObject(dictEq) {
  return new Data_Eq.Eq(function (m1) {
    return function (m2) {
      return isSubmap(dictEq)(m1)(m2) && isSubmap(dictEq)(m2)(m1);
    };
  });
};

var ordObject = function ordObject(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqObject(dictOrd.Eq0());
  }, function (m1) {
    return function (m2) {
      return Data_Ord.compare(Data_Ord.ordArray(Data_Tuple.ordTuple(Data_Ord.ordString)(dictOrd)))(toAscArray(m1))(toAscArray(m2));
    };
  });
};

var eq1Object = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqObject(dictEq));
});

var $$delete = function $$delete(k) {
  return mutate(Foreign_Object_ST["delete"](k));
};

var pop = function pop(k) {
  return function (m) {
    return Data_Functor.mapFlipped(Data_Maybe.functorMaybe)(lookup(k)(m))(function (a) {
      return new Data_Tuple.Tuple(a, $$delete(k)(m));
    });
  };
};

var alter = function alter(f) {
  return function (k) {
    return function (m) {
      var v = f(lookup(k)(m));

      if (v instanceof Data_Maybe.Nothing) {
        return $$delete(k)(m);
      }

      ;

      if (v instanceof Data_Maybe.Just) {
        return insert(k)(v.value0)(m);
      }

      ;
      throw new Error("Failed pattern match at Foreign.Object (line 206, column 15 - line 208, column 25): " + [v.constructor.name]);
    };
  };
};

var update = function update(f) {
  return function (k) {
    return function (m) {
      return alter(Data_Maybe.maybe(Data_Maybe.Nothing.value)(f))(k)(m);
    };
  };
};

module.exports = {
  isEmpty: isEmpty,
  singleton: singleton,
  insert: insert,
  lookup: lookup,
  toUnfoldable: toUnfoldable,
  toAscUnfoldable: toAscUnfoldable,
  fromFoldable: fromFoldable,
  fromFoldableWith: fromFoldableWith,
  fromHomogeneous: fromHomogeneous,
  "delete": $$delete,
  pop: pop,
  member: member,
  alter: alter,
  update: update,
  mapWithKey: mapWithKey,
  filterWithKey: filterWithKey,
  filterKeys: filterKeys,
  filter: filter,
  values: values,
  union: union,
  unions: unions,
  isSubmap: isSubmap,
  fold: fold,
  foldMap: foldMap,
  foldM: foldM,
  foldMaybe: foldMaybe,
  thawST: thawST,
  freezeST: freezeST,
  functorObject: functorObject,
  functorWithIndexObject: functorWithIndexObject,
  foldableObject: foldableObject,
  foldableWithIndexObject: foldableWithIndexObject,
  traversableObject: traversableObject,
  traversableWithIndexObject: traversableWithIndexObject,
  eqObject: eqObject,
  eq1Object: eq1Object,
  ordObject: ordObject,
  showObject: showObject,
  semigroupObject: semigroupObject,
  monoidObject: monoidObject,
  empty: $foreign.empty,
  size: $foreign.size,
  keys: $foreign.keys,
  all: $foreign.all,
  runST: $foreign.runST,
  toArrayWithKey: $foreign.toArrayWithKey
};
},{"./foreign.js":"../output/Foreign.Object/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad.ST.Internal/index.js":"../output/Control.Monad.ST.Internal/index.js","../Data.Array/index.js":"../output/Data.Array/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Function.Uncurried/index.js":"../output/Data.Function.Uncurried/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js","../Foreign.Object.ST/index.js":"../output/Foreign.Object.ST/index.js","../Unsafe.Coerce/index.js":"../output/Unsafe.Coerce/index.js"}],"../output/Record.Unsafe.Union/foreign.js":[function(require,module,exports) {
"use strict";

exports.unsafeUnionFn = function (r1, r2) {
  var copy = {};

  for (var k1 in r2) {
    if ({}.hasOwnProperty.call(r2, k1)) {
      copy[k1] = r2[k1];
    }
  }

  for (var k2 in r1) {
    if ({}.hasOwnProperty.call(r1, k2)) {
      copy[k2] = r1[k2];
    }
  }

  return copy;
};
},{}],"../output/Record.Unsafe.Union/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Function_Uncurried = require("../Data.Function.Uncurried/index.js");

var unsafeUnion = Data_Function_Uncurried.runFn2($foreign.unsafeUnionFn);
module.exports = {
  unsafeUnion: unsafeUnion,
  unsafeUnionFn: $foreign.unsafeUnionFn
};
},{"./foreign.js":"../output/Record.Unsafe.Union/foreign.js","../Data.Function.Uncurried/index.js":"../output/Data.Function.Uncurried/index.js"}],"../output/Record/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Eq = require("../Data.Eq/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Record_Unsafe = require("../Record.Unsafe/index.js");

var Record_Unsafe_Union = require("../Record.Unsafe.Union/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var Unsafe_Coerce = require("../Unsafe.Coerce/index.js");

var EqualFields = function EqualFields(equalFields) {
  this.equalFields = equalFields;
};

var union = function union(dictUnion) {
  return function (l) {
    return function (r) {
      return Record_Unsafe_Union.unsafeUnionFn(l, r);
    };
  };
};

var set = function set(dictIsSymbol) {
  return function (dictCons) {
    return function (dictCons1) {
      return function (l) {
        return function (b) {
          return function (r) {
            return Record_Unsafe.unsafeSet(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(b)(r);
          };
        };
      };
    };
  };
};

var nub = function nub(dictNub) {
  return Unsafe_Coerce.unsafeCoerce;
};

var merge = function merge(dictUnion) {
  return function (dictNub) {
    return function (l) {
      return function (r) {
        return Record_Unsafe_Union.unsafeUnionFn(l, r);
      };
    };
  };
};

var insert = function insert(dictIsSymbol) {
  return function (dictLacks) {
    return function (dictCons) {
      return function (l) {
        return function (a) {
          return function (r) {
            return Record_Unsafe.unsafeSet(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(a)(r);
          };
        };
      };
    };
  };
};

var get = function get(dictIsSymbol) {
  return function (dictCons) {
    return function (l) {
      return function (r) {
        return Record_Unsafe.unsafeGet(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(r);
      };
    };
  };
};

var modify = function modify(dictIsSymbol) {
  return function (dictCons) {
    return function (dictCons1) {
      return function (l) {
        return function (f) {
          return function (r) {
            return set(dictIsSymbol)()()(l)(f(get(dictIsSymbol)()(l)(r)))(r);
          };
        };
      };
    };
  };
};

var equalFieldsNil = new EqualFields(function (v) {
  return function (v1) {
    return function (v2) {
      return true;
    };
  };
});

var equalFields = function equalFields(dict) {
  return dict.equalFields;
};

var equalFieldsCons = function equalFieldsCons(dictIsSymbol) {
  return function (dictEq) {
    return function (dictCons) {
      return function (dictEqualFields) {
        return new EqualFields(function (v) {
          return function (a) {
            return function (b) {
              var get$prime = get(dictIsSymbol)()(Data_Symbol.SProxy.value);
              var equalRest = equalFields(dictEqualFields)(Type_Data_RowList.RLProxy.value);
              return Data_Eq.eq(dictEq)(get$prime(a))(get$prime(b)) && equalRest(a)(b);
            };
          };
        });
      };
    };
  };
};

var equal = function equal(dictRowToList) {
  return function (dictEqualFields) {
    return function (a) {
      return function (b) {
        return equalFields(dictEqualFields)(Type_Data_RowList.RLProxy.value)(a)(b);
      };
    };
  };
};

var disjointUnion = function disjointUnion(dictUnion) {
  return function (dictNub) {
    return function (l) {
      return function (r) {
        return Record_Unsafe_Union.unsafeUnionFn(l, r);
      };
    };
  };
};

var $$delete = function $$delete(dictIsSymbol) {
  return function (dictLacks) {
    return function (dictCons) {
      return function (l) {
        return function (r) {
          return Record_Unsafe.unsafeDelete(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(r);
        };
      };
    };
  };
};

var rename = function rename(dictIsSymbol) {
  return function (dictIsSymbol1) {
    return function (dictCons) {
      return function (dictLacks) {
        return function (dictCons1) {
          return function (dictLacks1) {
            return function (prev) {
              return function (next) {
                return function (record) {
                  return insert(dictIsSymbol1)()()(next)(get(dictIsSymbol)()(prev)(record))($$delete(dictIsSymbol)()()(prev)(record));
                };
              };
            };
          };
        };
      };
    };
  };
};

module.exports = {
  get: get,
  set: set,
  modify: modify,
  insert: insert,
  "delete": $$delete,
  rename: rename,
  equal: equal,
  merge: merge,
  union: union,
  disjointUnion: disjointUnion,
  nub: nub,
  EqualFields: EqualFields,
  equalFields: equalFields,
  equalFieldsCons: equalFieldsCons,
  equalFieldsNil: equalFieldsNil
};
},{"../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Record.Unsafe/index.js":"../output/Record.Unsafe/index.js","../Record.Unsafe.Union/index.js":"../output/Record.Unsafe.Union/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js","../Unsafe.Coerce/index.js":"../output/Unsafe.Coerce/index.js"}],"../output/Record.Builder/foreign.js":[function(require,module,exports) {
"use strict";

exports.copyRecord = function (rec) {
  var copy = {};

  for (var key in rec) {
    if ({}.hasOwnProperty.call(rec, key)) {
      copy[key] = rec[key];
    }
  }

  return copy;
};

exports.unsafeInsert = function (l) {
  return function (a) {
    return function (rec) {
      rec[l] = a;
      return rec;
    };
  };
};

exports.unsafeModify = function (l) {
  return function (f) {
    return function (rec) {
      rec[l] = f(rec[l]);
      return rec;
    };
  };
};

exports.unsafeDelete = function (l) {
  return function (rec) {
    delete rec[l];
    return rec;
  };
};

exports.unsafeRename = function (l1) {
  return function (l2) {
    return function (rec) {
      rec[l2] = rec[l1];
      delete rec[l1];
      return rec;
    };
  };
};
},{}],"../output/Record.Builder/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Record_Unsafe_Union = require("../Record.Unsafe.Union/index.js");

var Unsafe_Coerce = require("../Unsafe.Coerce/index.js");

var Builder = function Builder(x) {
  return x;
};

var union = function union(dictUnion) {
  return function (r2) {
    return function (r1) {
      return Record_Unsafe_Union.unsafeUnionFn(r1, r2);
    };
  };
};

var semigroupoidBuilder = Control_Semigroupoid.semigroupoidFn;

var rename = function rename(dictIsSymbol) {
  return function (dictIsSymbol1) {
    return function (dictCons) {
      return function (dictLacks) {
        return function (dictCons1) {
          return function (dictLacks1) {
            return function (l1) {
              return function (l2) {
                return function (r1) {
                  return $foreign.unsafeRename(Data_Symbol.reflectSymbol(dictIsSymbol)(l1))(Data_Symbol.reflectSymbol(dictIsSymbol1)(l2))(r1);
                };
              };
            };
          };
        };
      };
    };
  };
};

var nub = function nub(dictNub) {
  return Unsafe_Coerce.unsafeCoerce;
};

var modify = function modify(dictCons) {
  return function (dictCons1) {
    return function (dictIsSymbol) {
      return function (l) {
        return function (f) {
          return function (r1) {
            return $foreign.unsafeModify(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(f)(r1);
          };
        };
      };
    };
  };
};

var merge = function merge(dictUnion) {
  return function (dictNub) {
    return function (r2) {
      return function (r1) {
        return Record_Unsafe_Union.unsafeUnionFn(r1, r2);
      };
    };
  };
};

var insert = function insert(dictCons) {
  return function (dictLacks) {
    return function (dictIsSymbol) {
      return function (l) {
        return function (a) {
          return function (r1) {
            return $foreign.unsafeInsert(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(a)(r1);
          };
        };
      };
    };
  };
};

var disjointUnion = function disjointUnion(dictUnion) {
  return function (dictNub) {
    return function (r1) {
      return function (r2) {
        return Record_Unsafe_Union.unsafeUnionFn(r1, r2);
      };
    };
  };
};

var $$delete = function $$delete(dictIsSymbol) {
  return function (dictLacks) {
    return function (dictCons) {
      return function (l) {
        return function (r2) {
          return $foreign.unsafeDelete(Data_Symbol.reflectSymbol(dictIsSymbol)(l))(r2);
        };
      };
    };
  };
};

var categoryBuilder = Control_Category.categoryFn;

var build = function build(v) {
  return function (r1) {
    return v($foreign.copyRecord(r1));
  };
};

module.exports = {
  build: build,
  insert: insert,
  modify: modify,
  "delete": $$delete,
  rename: rename,
  merge: merge,
  union: union,
  disjointUnion: disjointUnion,
  nub: nub,
  semigroupoidBuilder: semigroupoidBuilder,
  categoryBuilder: categoryBuilder
};
},{"./foreign.js":"../output/Record.Builder/foreign.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Record.Unsafe.Union/index.js":"../output/Record.Unsafe.Union/index.js","../Unsafe.Coerce/index.js":"../output/Unsafe.Coerce/index.js"}],"../output/Type.Proxy/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_BooleanAlgebra = require("../Data.BooleanAlgebra/index.js");

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_CommutativeRing = require("../Data.CommutativeRing/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Ring = require("../Data.Ring/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Proxy3 = function () {
  function Proxy3() {}

  ;
  Proxy3.value = new Proxy3();
  return Proxy3;
}();

var Proxy2 = function () {
  function Proxy2() {}

  ;
  Proxy2.value = new Proxy2();
  return Proxy2;
}();

var $$Proxy = function () {
  function $$Proxy() {}

  ;
  $$Proxy.value = new $$Proxy();
  return $$Proxy;
}();

var showProxy3 = new Data_Show.Show(function (v) {
  return "Proxy3";
});
var showProxy2 = new Data_Show.Show(function (v) {
  return "Proxy2";
});
var showProxy = new Data_Show.Show(function (v) {
  return "Proxy";
});
var semiringProxy3 = new Data_Semiring.Semiring(function (v) {
  return function (v1) {
    return Proxy3.value;
  };
}, function (v) {
  return function (v1) {
    return Proxy3.value;
  };
}, Proxy3.value, Proxy3.value);
var semiringProxy2 = new Data_Semiring.Semiring(function (v) {
  return function (v1) {
    return Proxy2.value;
  };
}, function (v) {
  return function (v1) {
    return Proxy2.value;
  };
}, Proxy2.value, Proxy2.value);
var semiringProxy = new Data_Semiring.Semiring(function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
}, function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
}, $$Proxy.value, $$Proxy.value);
var semigroupProxy3 = new Data_Semigroup.Semigroup(function (v) {
  return function (v1) {
    return Proxy3.value;
  };
});
var semigroupProxy2 = new Data_Semigroup.Semigroup(function (v) {
  return function (v1) {
    return Proxy2.value;
  };
});
var semigroupProxy = new Data_Semigroup.Semigroup(function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
});
var ringProxy3 = new Data_Ring.Ring(function () {
  return semiringProxy3;
}, function (v) {
  return function (v1) {
    return Proxy3.value;
  };
});
var ringProxy2 = new Data_Ring.Ring(function () {
  return semiringProxy2;
}, function (v) {
  return function (v1) {
    return Proxy2.value;
  };
});
var ringProxy = new Data_Ring.Ring(function () {
  return semiringProxy;
}, function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
});
var heytingAlgebraProxy3 = new Data_HeytingAlgebra.HeytingAlgebra(function (v) {
  return function (v1) {
    return Proxy3.value;
  };
}, function (v) {
  return function (v1) {
    return Proxy3.value;
  };
}, Proxy3.value, function (v) {
  return function (v1) {
    return Proxy3.value;
  };
}, function (v) {
  return Proxy3.value;
}, Proxy3.value);
var heytingAlgebraProxy2 = new Data_HeytingAlgebra.HeytingAlgebra(function (v) {
  return function (v1) {
    return Proxy2.value;
  };
}, function (v) {
  return function (v1) {
    return Proxy2.value;
  };
}, Proxy2.value, function (v) {
  return function (v1) {
    return Proxy2.value;
  };
}, function (v) {
  return Proxy2.value;
}, Proxy2.value);
var heytingAlgebraProxy = new Data_HeytingAlgebra.HeytingAlgebra(function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
}, function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
}, $$Proxy.value, function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
}, function (v) {
  return $$Proxy.value;
}, $$Proxy.value);
var functorProxy = new Data_Functor.Functor(function (f) {
  return function (m) {
    return $$Proxy.value;
  };
});
var eqProxy3 = new Data_Eq.Eq(function (x) {
  return function (y) {
    return true;
  };
});
var ordProxy3 = new Data_Ord.Ord(function () {
  return eqProxy3;
}, function (x) {
  return function (y) {
    return Data_Ordering.EQ.value;
  };
});
var eqProxy2 = new Data_Eq.Eq(function (x) {
  return function (y) {
    return true;
  };
});
var ordProxy2 = new Data_Ord.Ord(function () {
  return eqProxy2;
}, function (x) {
  return function (y) {
    return Data_Ordering.EQ.value;
  };
});
var eqProxy = new Data_Eq.Eq(function (x) {
  return function (y) {
    return true;
  };
});
var ordProxy = new Data_Ord.Ord(function () {
  return eqProxy;
}, function (x) {
  return function (y) {
    return Data_Ordering.EQ.value;
  };
});
var discardProxy3 = new Control_Bind.Discard(function (dictBind) {
  return Control_Bind.bind(dictBind);
});
var discardProxy2 = new Control_Bind.Discard(function (dictBind) {
  return Control_Bind.bind(dictBind);
});
var discardProxy = new Control_Bind.Discard(function (dictBind) {
  return Control_Bind.bind(dictBind);
});
var commutativeRingProxy3 = new Data_CommutativeRing.CommutativeRing(function () {
  return ringProxy3;
});
var commutativeRingProxy2 = new Data_CommutativeRing.CommutativeRing(function () {
  return ringProxy2;
});
var commutativeRingProxy = new Data_CommutativeRing.CommutativeRing(function () {
  return ringProxy;
});
var boundedProxy3 = new Data_Bounded.Bounded(function () {
  return ordProxy3;
}, Proxy3.value, Proxy3.value);
var boundedProxy2 = new Data_Bounded.Bounded(function () {
  return ordProxy2;
}, Proxy2.value, Proxy2.value);
var boundedProxy = new Data_Bounded.Bounded(function () {
  return ordProxy;
}, $$Proxy.value, $$Proxy.value);
var booleanAlgebraProxy3 = new Data_BooleanAlgebra.BooleanAlgebra(function () {
  return heytingAlgebraProxy3;
});
var booleanAlgebraProxy2 = new Data_BooleanAlgebra.BooleanAlgebra(function () {
  return heytingAlgebraProxy2;
});
var booleanAlgebraProxy = new Data_BooleanAlgebra.BooleanAlgebra(function () {
  return heytingAlgebraProxy;
});
var applyProxy = new Control_Apply.Apply(function () {
  return functorProxy;
}, function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
});
var bindProxy = new Control_Bind.Bind(function () {
  return applyProxy;
}, function (v) {
  return function (v1) {
    return $$Proxy.value;
  };
});
var applicativeProxy = new Control_Applicative.Applicative(function () {
  return applyProxy;
}, function (v) {
  return $$Proxy.value;
});
var monadProxy = new Control_Monad.Monad(function () {
  return applicativeProxy;
}, function () {
  return bindProxy;
});
module.exports = {
  "Proxy": $$Proxy,
  Proxy2: Proxy2,
  Proxy3: Proxy3,
  eqProxy: eqProxy,
  functorProxy: functorProxy,
  ordProxy: ordProxy,
  applicativeProxy: applicativeProxy,
  applyProxy: applyProxy,
  bindProxy: bindProxy,
  booleanAlgebraProxy: booleanAlgebraProxy,
  boundedProxy: boundedProxy,
  commutativeRingProxy: commutativeRingProxy,
  discardProxy: discardProxy,
  heytingAlgebraProxy: heytingAlgebraProxy,
  monadProxy: monadProxy,
  ringProxy: ringProxy,
  semigroupProxy: semigroupProxy,
  semiringProxy: semiringProxy,
  showProxy: showProxy,
  eqProxy2: eqProxy2,
  ordProxy2: ordProxy2,
  booleanAlgebraProxy2: booleanAlgebraProxy2,
  boundedProxy2: boundedProxy2,
  commutativeRingProxy2: commutativeRingProxy2,
  discardProxy2: discardProxy2,
  heytingAlgebraProxy2: heytingAlgebraProxy2,
  ringProxy2: ringProxy2,
  semigroupProxy2: semigroupProxy2,
  semiringProxy2: semiringProxy2,
  showProxy2: showProxy2,
  eqProxy3: eqProxy3,
  ordProxy3: ordProxy3,
  booleanAlgebraProxy3: booleanAlgebraProxy3,
  boundedProxy3: boundedProxy3,
  commutativeRingProxy3: commutativeRingProxy3,
  discardProxy3: discardProxy3,
  heytingAlgebraProxy3: heytingAlgebraProxy3,
  ringProxy3: ringProxy3,
  semigroupProxy3: semigroupProxy3,
  semiringProxy3: semiringProxy3,
  showProxy3: showProxy3
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.BooleanAlgebra/index.js":"../output/Data.BooleanAlgebra/index.js","../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.CommutativeRing/index.js":"../output/Data.CommutativeRing/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Ring/index.js":"../output/Data.Ring/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Foreign.Generic.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Monad_Except = require("../Control.Monad.Except/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Array = require("../Data.Array/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Generic_Rep = require("../Data.Generic.Rep/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_List = require("../Data.List/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Data_Void = require("../Data.Void/index.js");

var Foreign = require("../Foreign/index.js");

var Foreign_Generic_Internal = require("../Foreign.Generic.Internal/index.js");

var Foreign_Index = require("../Foreign.Index/index.js");

var Foreign_NullOrUndefined = require("../Foreign.NullOrUndefined/index.js");

var Foreign_Object = require("../Foreign.Object/index.js");

var Record = require("../Record/index.js");

var Record_Builder = require("../Record.Builder/index.js");

var Type_Data_RowList = require("../Type.Data.RowList/index.js");

var Type_Proxy = require("../Type.Proxy/index.js");

var TaggedObject = function () {
  function TaggedObject(value0) {
    this.value0 = value0;
  }

  ;

  TaggedObject.create = function (value0) {
    return new TaggedObject(value0);
  };

  return TaggedObject;
}();

var GenericEncodeArgs = function GenericEncodeArgs(encodeArgs) {
  this.encodeArgs = encodeArgs;
};

var GenericEncode = function GenericEncode(encodeOpts) {
  this.encodeOpts = encodeOpts;
};

var GenericDecodeArgs = function GenericDecodeArgs(decodeArgs) {
  this.decodeArgs = decodeArgs;
};

var GenericDecode = function GenericDecode(decodeOpts) {
  this.decodeOpts = decodeOpts;
};

var GenericCountArgs = function GenericCountArgs(countArgs) {
  this.countArgs = countArgs;
};

var EncodeWithOptions = function EncodeWithOptions(encodeWithOptions) {
  this.encodeWithOptions = encodeWithOptions;
};

var EncodeRecord = function EncodeRecord(encodeRecordWithOptions) {
  this.encodeRecordWithOptions = encodeRecordWithOptions;
};

var Encode = function Encode(encode) {
  this.encode = encode;
};

var DecodeWithOptions = function DecodeWithOptions(decodeWithOptions) {
  this.decodeWithOptions = decodeWithOptions;
};

var DecodeRecord = function DecodeRecord(decodeRecordWithOptions) {
  this.decodeRecordWithOptions = decodeRecordWithOptions;
};

var Decode = function Decode(decode) {
  this.decode = decode;
};

var voidEncode = new Encode(Data_Void.absurd);
var voidDecode = new Decode(function (v) {
  return Control_Monad_Except_Trans.except(Data_Identity.applicativeIdentity)(new Data_Either.Left(Control_Applicative.pure(Data_List_Types.applicativeNonEmptyList)(new Foreign.ForeignError("Decode: void"))));
});
var unitEncode = new Encode(function (v) {
  return Foreign.unsafeToForeign({});
});
var unitDecode = new Decode(function (v) {
  return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Unit.unit);
});
var stringEncode = new Encode(Foreign.unsafeToForeign);
var stringDecode = new Decode(Foreign.readString);
var numberEncode = new Encode(Foreign.unsafeToForeign);
var numberDecode = new Decode(Foreign.readNumber);
var intEncode = new Encode(Foreign.unsafeToForeign);
var intDecode = new Decode(Foreign.readInt);
var genericEncodeArgsNoArguments = new GenericEncodeArgs(function (v) {
  return Data_Monoid.mempty(Data_Monoid.monoidFn(Data_List_Types.monoidList));
});
var genericDecodeNoConstructors = new GenericDecode(function (opts) {
  return function (v) {
    return Foreign.fail(new Foreign.ForeignError("No constructors"));
  };
});
var genericDecodeArgsNoArguments = new GenericDecodeArgs(function (v) {
  return function (v1) {
    return function (v2) {
      if (v2 instanceof Data_List_Types.Nil) {
        return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))({
          result: Data_Generic_Rep.NoArguments.value,
          rest: Data_List_Types.Nil.value,
          next: v1
        });
      }

      ;
      return Foreign.fail(new Foreign.ForeignError("Too many constructor arguments"));
    };
  };
});
var genericCountArgsNoArguments = new GenericCountArgs(function (v) {
  return new Data_Either.Left(Data_Generic_Rep.NoArguments.value);
});
var genericCountArgsArgument = new GenericCountArgs(function (v) {
  return new Data_Either.Right(1);
});
var foreignEncode = new Encode(Control_Category.identity(Control_Category.categoryFn));
var foreignDecode = new Decode(Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity)));

var encodeWithOptions = function encodeWithOptions(dict) {
  return dict.encodeWithOptions;
};

var genericEncodeArgsArgument = function genericEncodeArgsArgument(dictEncodeWithOptions) {
  return new GenericEncodeArgs(function (opts) {
    return function (v) {
      return Data_List.singleton(encodeWithOptions(dictEncodeWithOptions)(opts)(v));
    };
  });
};

var encodeRecordWithOptions = function encodeRecordWithOptions(dict) {
  return dict.encodeRecordWithOptions;
};

var encodeWithOptionsRecord = function encodeWithOptionsRecord(dictRowToList) {
  return function (dictEncodeRecord) {
    return new EncodeWithOptions(function (opts) {
      var $148 = encodeRecordWithOptions(dictEncodeRecord)(Type_Data_RowList.RLProxy.value)(opts);
      return function ($149) {
        return Foreign.unsafeToForeign($148($149));
      };
    });
  };
};

var encodeRecordNil = new EncodeRecord(function (v) {
  return function (v1) {
    return function (v2) {
      return Foreign_Object.empty;
    };
  };
});

var encodeRecordCons = function encodeRecordCons(dictCons) {
  return function (dictEncodeRecord) {
    return function (dictIsSymbol) {
      return function (dictEncodeWithOptions) {
        return new EncodeRecord(function (v) {
          return function (opts) {
            return function (rec) {
              var obj = encodeRecordWithOptions(dictEncodeRecord)(Type_Data_RowList.RLProxy.value)(opts)(rec);
              var l = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
              return Foreign_Object.insert(opts.fieldTransform(l))(encodeWithOptions(dictEncodeWithOptions)(opts)(Record.get(dictIsSymbol)()(Data_Symbol.SProxy.value)(rec)))(obj);
            };
          };
        });
      };
    };
  };
};

var encodeOpts = function encodeOpts(dict) {
  return dict.encodeOpts;
};

var genericEncodeNoConstructors = new GenericEncode(function (opts) {
  return function (a) {
    return encodeOpts(genericEncodeNoConstructors)(opts)(a);
  };
});

var genericEncodeSum = function genericEncodeSum(dictGenericEncode) {
  return function (dictGenericEncode1) {
    return new GenericEncode(function (opts) {
      return function (v) {
        if (v instanceof Data_Generic_Rep.Inl) {
          return encodeOpts(dictGenericEncode)({
            sumEncoding: opts.sumEncoding,
            unwrapSingleConstructors: false,
            unwrapSingleArguments: opts.unwrapSingleArguments,
            fieldTransform: opts.fieldTransform
          })(v.value0);
        }

        ;

        if (v instanceof Data_Generic_Rep.Inr) {
          return encodeOpts(dictGenericEncode1)({
            sumEncoding: opts.sumEncoding,
            unwrapSingleConstructors: false,
            unwrapSingleArguments: opts.unwrapSingleArguments,
            fieldTransform: opts.fieldTransform
          })(v.value0);
        }

        ;
        throw new Error("Failed pattern match at Foreign.Generic.Class (line 351, column 1 - line 355, column 85): " + [opts.constructor.name, v.constructor.name]);
      };
    });
  };
};

var encodeArgs = function encodeArgs(dict) {
  return dict.encodeArgs;
};

var genericEncodeArgsProduct = function genericEncodeArgsProduct(dictGenericEncodeArgs) {
  return function (dictGenericEncodeArgs1) {
    return new GenericEncodeArgs(function (opts) {
      return function (v) {
        return Data_Semigroup.append(Data_List_Types.semigroupList)(encodeArgs(dictGenericEncodeArgs)(opts)(v.value0))(encodeArgs(dictGenericEncodeArgs1)(opts)(v.value1));
      };
    });
  };
};

var genericEncodeConstructor = function genericEncodeConstructor(dictIsSymbol) {
  return function (dictGenericEncodeArgs) {
    return new GenericEncode(function (opts) {
      return function (v) {
        var unwrapArguments = function unwrapArguments(v1) {
          if (v1.length === 0) {
            return Data_Maybe.Nothing.value;
          }

          ;

          if (v1.length === 1 && opts.unwrapSingleArguments) {
            return new Data_Maybe.Just(v1[0]);
          }

          ;
          return new Data_Maybe.Just(Foreign.unsafeToForeign(v1));
        };

        var encodeArgsArray = function () {
          var $150 = Data_List.toUnfoldable(Data_Unfoldable.unfoldableArray);
          var $151 = encodeArgs(dictGenericEncodeArgs)(opts);
          return function ($152) {
            return unwrapArguments($150($151($152)));
          };
        }();

        var ctorName = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);

        if (opts.unwrapSingleConstructors) {
          return Data_Maybe.maybe(Foreign.unsafeToForeign({}))(Foreign.unsafeToForeign)(encodeArgsArray(v));
        }

        ;
        return Foreign.unsafeToForeign(Foreign_Object.union(Foreign_Object.singleton(opts.sumEncoding.value0.tagFieldName)(Foreign.unsafeToForeign(opts.sumEncoding.value0.constructorTagTransform(ctorName))))(Data_Maybe.maybe(Foreign_Object.empty)(Foreign_Object.singleton(opts.sumEncoding.value0.contentsFieldName))(encodeArgsArray(v))));
      };
    });
  };
};

var encode = function encode(dict) {
  return dict.encode;
};

var encodeWithOptionsOther = function encodeWithOptionsOther(dictEncode) {
  return new EncodeWithOptions(function (v) {
    return encode(dictEncode);
  });
};

var identityEncode = function identityEncode(dictEncode) {
  return new Encode(function () {
    var $153 = encode(dictEncode);
    var $154 = Data_Newtype.unwrap(Data_Identity.newtypeIdentity);
    return function ($155) {
      return $153($154($155));
    };
  }());
};

var maybeEncode = function maybeEncode(dictEncode) {
  return new Encode(Data_Maybe.maybe(Foreign_NullOrUndefined["null"])(encode(dictEncode)));
};

var objectEncode = function objectEncode(dictEncode) {
  return new Encode(function () {
    var $156 = Foreign_Object.mapWithKey(function (v) {
      return encode(dictEncode);
    });
    return function ($157) {
      return Foreign.unsafeToForeign($156($157));
    };
  }());
};

var defaultOptions = {
  sumEncoding: new TaggedObject({
    tagFieldName: "tag",
    contentsFieldName: "contents",
    constructorTagTransform: Control_Category.identity(Control_Category.categoryFn)
  }),
  unwrapSingleConstructors: false,
  unwrapSingleArguments: true,
  fieldTransform: Control_Category.identity(Control_Category.categoryFn)
};

var recordEncode = function recordEncode(dictRowToList) {
  return function (dictEncodeRecord) {
    return new Encode(encodeWithOptions(encodeWithOptionsRecord()(dictEncodeRecord))(defaultOptions));
  };
};

var decodeWithOptions = function decodeWithOptions(dict) {
  return dict.decodeWithOptions;
};

var genericDecodeArgsArgument = function genericDecodeArgsArgument(dictDecodeWithOptions) {
  return new GenericDecodeArgs(function (v) {
    return function (v1) {
      return function (v2) {
        if (v2 instanceof Data_List_Types.Cons) {
          return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Monad_Except.mapExcept(Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Foreign.ErrorAtIndex.create(v1))))(decodeWithOptions(dictDecodeWithOptions)(v)(v2.value0)))(function (a) {
            return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))({
              result: a,
              rest: v2.value1,
              next: v1 + 1 | 0
            });
          });
        }

        ;
        return Foreign.fail(new Foreign.ForeignError("Not enough constructor arguments"));
      };
    };
  });
};

var decodeRecordWithOptions = function decodeRecordWithOptions(dict) {
  return dict.decodeRecordWithOptions;
};

var decodeWithOptionsRecord = function decodeWithOptionsRecord(dictRowToList) {
  return function (dictDecodeRecord) {
    return new DecodeWithOptions(function (opts) {
      return Data_Functor.map(Data_Functor.functorFn)(Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Data_Function.flip(Record_Builder.build)({})))(decodeRecordWithOptions(dictDecodeRecord)(Type_Data_RowList.RLProxy.value)(opts));
    });
  };
};

var recordDecode = function recordDecode(dictRowToList) {
  return function (dictDecodeRecord) {
    return new Decode(decodeWithOptions(decodeWithOptionsRecord()(dictDecodeRecord))(defaultOptions));
  };
};

var decodeRecordNil = new DecodeRecord(function (v) {
  return function (v1) {
    return function (v2) {
      return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Control_Category.identity(Record_Builder.categoryBuilder));
    };
  };
});

var decodeRecordCons = function decodeRecordCons(dictCons) {
  return function (dictDecodeRecord) {
    return function (dictIsSymbol) {
      return function (dictDecodeWithOptions) {
        return function (dictLacks) {
          return new DecodeRecord(function (v) {
            return function (opts) {
              return function (f) {
                return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(decodeRecordWithOptions(dictDecodeRecord)(Type_Data_RowList.RLProxy.value)(opts)(f))(function (builder) {
                  var l = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
                  var l_transformed = opts.fieldTransform(l);
                  return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Foreign_Index.index(Foreign_Index.indexString)(f)(l_transformed))(function (f_) {
                    return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Monad_Except.mapExcept(Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Foreign.ErrorAtProperty.create(l_transformed))))(decodeWithOptions(dictDecodeWithOptions)(opts)(f_)))(function (a) {
                      return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Control_Semigroupoid.composeFlipped(Record_Builder.semigroupoidBuilder)(builder)(Record_Builder.insert()()(dictIsSymbol)(Data_Symbol.SProxy.value)(a)));
                    });
                  });
                });
              };
            };
          });
        };
      };
    };
  };
};

var decodeOpts = function decodeOpts(dict) {
  return dict.decodeOpts;
};

var genericDecodeSum = function genericDecodeSum(dictGenericDecode) {
  return function (dictGenericDecode1) {
    return new GenericDecode(function (opts) {
      return function (f) {
        var opts$prime = {
          unwrapSingleConstructors: false,
          fieldTransform: opts.fieldTransform,
          sumEncoding: opts.sumEncoding,
          unwrapSingleArguments: opts.unwrapSingleArguments
        };
        return Control_Alt.alt(Control_Monad_Except_Trans.altExceptT(Data_List_Types.semigroupNonEmptyList)(Data_Identity.monadIdentity))(Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Data_Generic_Rep.Inl.create)(decodeOpts(dictGenericDecode)(opts$prime)(f)))(Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Data_Generic_Rep.Inr.create)(decodeOpts(dictGenericDecode1)(opts$prime)(f)));
      };
    });
  };
};

var decodeArgs = function decodeArgs(dict) {
  return dict.decodeArgs;
};

var genericDecodeArgsProduct = function genericDecodeArgsProduct(dictGenericDecodeArgs) {
  return function (dictGenericDecodeArgs1) {
    return new GenericDecodeArgs(function (opts) {
      return function (i) {
        return function (xs) {
          return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(decodeArgs(dictGenericDecodeArgs)(opts)(i)(xs))(function (v) {
            return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(decodeArgs(dictGenericDecodeArgs1)(opts)(v.next)(v.rest))(function (v1) {
              return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))({
                result: new Data_Generic_Rep.Product(v.result, v1.result),
                rest: v1.rest,
                next: v1.next
              });
            });
          });
        };
      };
    });
  };
};

var decode = function decode(dict) {
  return dict.decode;
};

var decodeWithOptionsOther = function decodeWithOptionsOther(dictDecode) {
  return new DecodeWithOptions(function (v) {
    return decode(dictDecode);
  });
};

var identityDecode = function identityDecode(dictDecode) {
  return new Decode(function () {
    var $158 = Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Data_Identity.Identity);
    var $159 = decode(dictDecode);
    return function ($160) {
      return $158($159($160));
    };
  }());
};

var maybeDecode = function maybeDecode(dictDecode) {
  return new Decode(Foreign_NullOrUndefined.readNullOrUndefined(decode(dictDecode)));
};

var objectDecode = function objectDecode(dictDecode) {
  return new Decode(Control_Bind.composeKleisliFlipped(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(function () {
    var $161 = Data_Traversable.sequence(Foreign_Object.traversableObject)(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity));
    var $162 = Foreign_Object.mapWithKey(function (v) {
      return decode(dictDecode);
    });
    return function ($163) {
      return $161($162($163));
    };
  }())(Foreign_Generic_Internal.readObject));
};

var countArgs = function countArgs(dict) {
  return dict.countArgs;
};

var genericCountArgsProduct = function genericCountArgsProduct(dictGenericCountArgs) {
  return function (dictGenericCountArgs1) {
    return new GenericCountArgs(function (v) {
      var v1 = countArgs(dictGenericCountArgs1)(Type_Proxy["Proxy"].value);
      var v2 = countArgs(dictGenericCountArgs)(Type_Proxy["Proxy"].value);

      if (v2 instanceof Data_Either.Left && v1 instanceof Data_Either.Left) {
        return new Data_Either.Left(new Data_Generic_Rep.Product(v2.value0, v1.value0));
      }

      ;

      if (v2 instanceof Data_Either.Left && v1 instanceof Data_Either.Right) {
        return new Data_Either.Right(v1.value0);
      }

      ;

      if (v2 instanceof Data_Either.Right && v1 instanceof Data_Either.Left) {
        return new Data_Either.Right(v2.value0);
      }

      ;

      if (v2 instanceof Data_Either.Right && v1 instanceof Data_Either.Right) {
        return new Data_Either.Right(v2.value0 + v1.value0 | 0);
      }

      ;
      throw new Error("Failed pattern match at Foreign.Generic.Class (line 400, column 5 - line 404, column 40): " + [v2.constructor.name, v1.constructor.name]);
    });
  };
};

var genericDecodeConstructor = function genericDecodeConstructor(dictIsSymbol) {
  return function (dictGenericDecodeArgs) {
    return function (dictGenericCountArgs) {
      return new GenericDecode(function (opts) {
        return function (f) {
          var numArgs = countArgs(dictGenericCountArgs)(Type_Proxy["Proxy"].value);

          var readArguments = function readArguments(args) {
            if (numArgs instanceof Data_Either.Left) {
              return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(numArgs.value0);
            }

            ;

            if (numArgs instanceof Data_Either.Right && numArgs.value0 === 1 && opts.unwrapSingleArguments) {
              return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(decodeArgs(dictGenericDecodeArgs)(opts)(0)(Data_List.singleton(args)))(function (v) {
                return Control_Bind.discard(Control_Bind.discardUnit)(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Applicative.unless(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_List["null"](v.rest))(Foreign.fail(new Foreign.ForeignError("Expected a single argument"))))(function () {
                  return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(v.result);
                });
              });
            }

            ;

            if (numArgs instanceof Data_Either.Right) {
              return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Foreign.readArray(args))(function (vals) {
                return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(decodeArgs(dictGenericDecodeArgs)(opts)(0)(Data_List.fromFoldable(Data_Foldable.foldableArray)(vals)))(function (v) {
                  return Control_Bind.discard(Control_Bind.discardUnit)(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Applicative.unless(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_List["null"](v.rest))(Foreign.fail(new Foreign.ForeignError("Expected " + (Data_Show.show(Data_Show.showInt)(numArgs.value0) + " constructor arguments")))))(function () {
                    return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(v.result);
                  });
                });
              });
            }

            ;
            throw new Error("Failed pattern match at Foreign.Generic.Class (line 307, column 9 - line 319, column 24): " + [numArgs.constructor.name]);
          };

          var ctorName = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);

          if (opts.unwrapSingleConstructors) {
            return Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Data_Generic_Rep.Constructor)(readArguments(f));
          }

          ;
          return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Monad_Except.mapExcept(Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Foreign.ErrorAtProperty.create(opts.sumEncoding.value0.tagFieldName))))(Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Foreign_Index.index(Foreign_Index.indexString)(f)(opts.sumEncoding.value0.tagFieldName))(Foreign.readString))(function (tag) {
            var expected = opts.sumEncoding.value0.constructorTagTransform(ctorName);
            return Control_Bind.discard(Control_Bind.discardUnit)(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Applicative.unless(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(tag === expected)(Foreign.fail(new Foreign.ForeignError("Expected " + (Data_Show.show(Data_Show.showString)(expected) + " tag")))))(function () {
              return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(tag);
            });
          })))(function (tag) {
            return Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Control_Monad_Except.mapExcept(Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Foreign.ErrorAtProperty.create(opts.sumEncoding.value0.contentsFieldName))))(Control_Bind.bind(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Foreign_Index.index(Foreign_Index.indexString)(f)(opts.sumEncoding.value0.contentsFieldName))(readArguments)))(function (args) {
              return Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(args);
            });
          });
        };
      });
    };
  };
};

var charEncode = new Encode(Foreign.unsafeToForeign);
var charDecode = new Decode(Foreign.readChar);
var booleanEncode = new Encode(Foreign.unsafeToForeign);
var booleanDecode = new Decode(Foreign.readBoolean);

var arrayEncode = function arrayEncode(dictEncode) {
  return new Encode(function () {
    var $164 = Data_Functor.map(Data_Functor.functorArray)(encode(dictEncode));
    return function ($165) {
      return Foreign.unsafeToForeign($164($165));
    };
  }());
};

var arrayDecode = function arrayDecode(dictDecode) {
  return new Decode(function () {
    var readElement = function readElement(i) {
      return function (value) {
        return Control_Monad_Except.mapExcept(Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Foreign.ErrorAtIndex.create(i))))(decode(dictDecode)(value));
      };
    };

    var readElements = function readElements(arr) {
      return Data_Traversable.sequence(Data_Traversable.traversableArray)(Control_Monad_Except_Trans.applicativeExceptT(Data_Identity.monadIdentity))(Data_Array.zipWith(readElement)(Data_Array.range(0)(Data_Array.length(arr)))(arr));
    };

    return Control_Bind.composeKleisli(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(Foreign.readArray)(readElements);
  }());
};

module.exports = {
  countArgs: countArgs,
  decode: decode,
  decodeArgs: decodeArgs,
  decodeOpts: decodeOpts,
  decodeRecordWithOptions: decodeRecordWithOptions,
  decodeWithOptions: decodeWithOptions,
  encode: encode,
  encodeArgs: encodeArgs,
  encodeOpts: encodeOpts,
  encodeRecordWithOptions: encodeRecordWithOptions,
  encodeWithOptions: encodeWithOptions,
  TaggedObject: TaggedObject,
  defaultOptions: defaultOptions,
  Decode: Decode,
  Encode: Encode,
  DecodeWithOptions: DecodeWithOptions,
  EncodeWithOptions: EncodeWithOptions,
  DecodeRecord: DecodeRecord,
  EncodeRecord: EncodeRecord,
  GenericDecode: GenericDecode,
  GenericEncode: GenericEncode,
  GenericDecodeArgs: GenericDecodeArgs,
  GenericEncodeArgs: GenericEncodeArgs,
  GenericCountArgs: GenericCountArgs,
  voidDecode: voidDecode,
  unitDecode: unitDecode,
  foreignDecode: foreignDecode,
  stringDecode: stringDecode,
  charDecode: charDecode,
  booleanDecode: booleanDecode,
  numberDecode: numberDecode,
  intDecode: intDecode,
  identityDecode: identityDecode,
  arrayDecode: arrayDecode,
  maybeDecode: maybeDecode,
  objectDecode: objectDecode,
  recordDecode: recordDecode,
  voidEncode: voidEncode,
  unitEncode: unitEncode,
  foreignEncode: foreignEncode,
  stringEncode: stringEncode,
  charEncode: charEncode,
  booleanEncode: booleanEncode,
  numberEncode: numberEncode,
  intEncode: intEncode,
  identityEncode: identityEncode,
  arrayEncode: arrayEncode,
  maybeEncode: maybeEncode,
  objectEncode: objectEncode,
  recordEncode: recordEncode,
  decodeWithOptionsRecord: decodeWithOptionsRecord,
  decodeWithOptionsOther: decodeWithOptionsOther,
  encodeWithOptionsRecord: encodeWithOptionsRecord,
  encodeWithOptionsOther: encodeWithOptionsOther,
  decodeRecordNil: decodeRecordNil,
  encodeRecordNil: encodeRecordNil,
  decodeRecordCons: decodeRecordCons,
  encodeRecordCons: encodeRecordCons,
  genericDecodeNoConstructors: genericDecodeNoConstructors,
  genericEncodeNoConstructors: genericEncodeNoConstructors,
  genericDecodeConstructor: genericDecodeConstructor,
  genericEncodeConstructor: genericEncodeConstructor,
  genericDecodeSum: genericDecodeSum,
  genericEncodeSum: genericEncodeSum,
  genericDecodeArgsNoArguments: genericDecodeArgsNoArguments,
  genericEncodeArgsNoArguments: genericEncodeArgsNoArguments,
  genericDecodeArgsArgument: genericDecodeArgsArgument,
  genericEncodeArgsArgument: genericEncodeArgsArgument,
  genericDecodeArgsProduct: genericDecodeArgsProduct,
  genericEncodeArgsProduct: genericEncodeArgsProduct,
  genericCountArgsNoArguments: genericCountArgsNoArguments,
  genericCountArgsArgument: genericCountArgsArgument,
  genericCountArgsProduct: genericCountArgsProduct
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad.Except/index.js":"../output/Control.Monad.Except/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Array/index.js":"../output/Data.Array/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Generic.Rep/index.js":"../output/Data.Generic.Rep/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.List/index.js":"../output/Data.List/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Data.Void/index.js":"../output/Data.Void/index.js","../Foreign/index.js":"../output/Foreign/index.js","../Foreign.Generic.Internal/index.js":"../output/Foreign.Generic.Internal/index.js","../Foreign.Index/index.js":"../output/Foreign.Index/index.js","../Foreign.NullOrUndefined/index.js":"../output/Foreign.NullOrUndefined/index.js","../Foreign.Object/index.js":"../output/Foreign.Object/index.js","../Record/index.js":"../output/Record/index.js","../Record.Builder/index.js":"../output/Record.Builder/index.js","../Type.Data.RowList/index.js":"../output/Type.Data.RowList/index.js","../Type.Proxy/index.js":"../output/Type.Proxy/index.js"}],"../output/Foreign.JSON/foreign.js":[function(require,module,exports) {
"use strict";

exports.parseJSONImpl = function (str) {
  return JSON.parse(str);
};
},{}],"../output/Effect.Uncurried/foreign.js":[function(require,module,exports) {
"use strict";

exports.mkEffectFn1 = function mkEffectFn1(fn) {
  return function (x) {
    return fn(x)();
  };
};

exports.mkEffectFn2 = function mkEffectFn2(fn) {
  return function (a, b) {
    return fn(a)(b)();
  };
};

exports.mkEffectFn3 = function mkEffectFn3(fn) {
  return function (a, b, c) {
    return fn(a)(b)(c)();
  };
};

exports.mkEffectFn4 = function mkEffectFn4(fn) {
  return function (a, b, c, d) {
    return fn(a)(b)(c)(d)();
  };
};

exports.mkEffectFn5 = function mkEffectFn5(fn) {
  return function (a, b, c, d, e) {
    return fn(a)(b)(c)(d)(e)();
  };
};

exports.mkEffectFn6 = function mkEffectFn6(fn) {
  return function (a, b, c, d, e, f) {
    return fn(a)(b)(c)(d)(e)(f)();
  };
};

exports.mkEffectFn7 = function mkEffectFn7(fn) {
  return function (a, b, c, d, e, f, g) {
    return fn(a)(b)(c)(d)(e)(f)(g)();
  };
};

exports.mkEffectFn8 = function mkEffectFn8(fn) {
  return function (a, b, c, d, e, f, g, h) {
    return fn(a)(b)(c)(d)(e)(f)(g)(h)();
  };
};

exports.mkEffectFn9 = function mkEffectFn9(fn) {
  return function (a, b, c, d, e, f, g, h, i) {
    return fn(a)(b)(c)(d)(e)(f)(g)(h)(i)();
  };
};

exports.mkEffectFn10 = function mkEffectFn10(fn) {
  return function (a, b, c, d, e, f, g, h, i, j) {
    return fn(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)();
  };
};

exports.runEffectFn1 = function runEffectFn1(fn) {
  return function (a) {
    return function () {
      return fn(a);
    };
  };
};

exports.runEffectFn2 = function runEffectFn2(fn) {
  return function (a) {
    return function (b) {
      return function () {
        return fn(a, b);
      };
    };
  };
};

exports.runEffectFn3 = function runEffectFn3(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function () {
          return fn(a, b, c);
        };
      };
    };
  };
};

exports.runEffectFn4 = function runEffectFn4(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function () {
            return fn(a, b, c, d);
          };
        };
      };
    };
  };
};

exports.runEffectFn5 = function runEffectFn5(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function () {
              return fn(a, b, c, d, e);
            };
          };
        };
      };
    };
  };
};

exports.runEffectFn6 = function runEffectFn6(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function () {
                return fn(a, b, c, d, e, f);
              };
            };
          };
        };
      };
    };
  };
};

exports.runEffectFn7 = function runEffectFn7(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return function () {
                  return fn(a, b, c, d, e, f, g);
                };
              };
            };
          };
        };
      };
    };
  };
};

exports.runEffectFn8 = function runEffectFn8(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return function (h) {
                  return function () {
                    return fn(a, b, c, d, e, f, g, h);
                  };
                };
              };
            };
          };
        };
      };
    };
  };
};

exports.runEffectFn9 = function runEffectFn9(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return function (h) {
                  return function (i) {
                    return function () {
                      return fn(a, b, c, d, e, f, g, h, i);
                    };
                  };
                };
              };
            };
          };
        };
      };
    };
  };
};

exports.runEffectFn10 = function runEffectFn10(fn) {
  return function (a) {
    return function (b) {
      return function (c) {
        return function (d) {
          return function (e) {
            return function (f) {
              return function (g) {
                return function (h) {
                  return function (i) {
                    return function (j) {
                      return function () {
                        return fn(a, b, c, d, e, f, g, h, i, j);
                      };
                    };
                  };
                };
              };
            };
          };
        };
      };
    };
  };
};
},{}],"../output/Effect.Uncurried/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

module.exports = {
  mkEffectFn1: $foreign.mkEffectFn1,
  mkEffectFn2: $foreign.mkEffectFn2,
  mkEffectFn3: $foreign.mkEffectFn3,
  mkEffectFn4: $foreign.mkEffectFn4,
  mkEffectFn5: $foreign.mkEffectFn5,
  mkEffectFn6: $foreign.mkEffectFn6,
  mkEffectFn7: $foreign.mkEffectFn7,
  mkEffectFn8: $foreign.mkEffectFn8,
  mkEffectFn9: $foreign.mkEffectFn9,
  mkEffectFn10: $foreign.mkEffectFn10,
  runEffectFn1: $foreign.runEffectFn1,
  runEffectFn2: $foreign.runEffectFn2,
  runEffectFn3: $foreign.runEffectFn3,
  runEffectFn4: $foreign.runEffectFn4,
  runEffectFn5: $foreign.runEffectFn5,
  runEffectFn6: $foreign.runEffectFn6,
  runEffectFn7: $foreign.runEffectFn7,
  runEffectFn8: $foreign.runEffectFn8,
  runEffectFn9: $foreign.runEffectFn9,
  runEffectFn10: $foreign.runEffectFn10
};
},{"./foreign.js":"../output/Effect.Uncurried/foreign.js"}],"../output/Effect.Unsafe/foreign.js":[function(require,module,exports) {
"use strict";

exports.unsafePerformEffect = function (f) {
  return f();
};
},{}],"../output/Effect.Unsafe/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

module.exports = {
  unsafePerformEffect: $foreign.unsafePerformEffect
};
},{"./foreign.js":"../output/Effect.Unsafe/foreign.js"}],"../output/Foreign.JSON/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Effect_Exception = require("../Effect.Exception/index.js");

var Effect_Uncurried = require("../Effect.Uncurried/index.js");

var Effect_Unsafe = require("../Effect.Unsafe/index.js");

var Foreign = require("../Foreign/index.js");

var parseJSON = function () {
  var $0 = Data_Bifunctor.lmap(Data_Either.bifunctorEither)(function () {
    var $3 = Control_Applicative.pure(Data_List_Types.applicativeNonEmptyList);
    return function ($4) {
      return $3(Foreign.ForeignError.create(Effect_Exception.message($4)));
    };
  }());
  var $1 = Effect_Uncurried.runEffectFn1($foreign.parseJSONImpl);
  return function ($2) {
    return Control_Monad_Except_Trans.ExceptT(Data_Identity.Identity($0(Effect_Unsafe.unsafePerformEffect(Effect_Exception["try"]($1($2))))));
  };
}();

var decodeJSONWith = function decodeJSONWith(f) {
  return Control_Bind.composeKleisliFlipped(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(f)(parseJSON);
};

module.exports = {
  parseJSON: parseJSON,
  decodeJSONWith: decodeJSONWith
};
},{"./foreign.js":"../output/Foreign.JSON/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Effect.Exception/index.js":"../output/Effect.Exception/index.js","../Effect.Uncurried/index.js":"../output/Effect.Uncurried/index.js","../Effect.Unsafe/index.js":"../output/Effect.Unsafe/index.js","../Foreign/index.js":"../output/Foreign/index.js"}],"../output/Global.Unsafe/foreign.js":[function(require,module,exports) {
/* globals exports, JSON */
"use strict";

exports.unsafeStringify = function (x) {
  return JSON.stringify(x);
};

exports.unsafeToFixed = function (digits) {
  return function (n) {
    return n.toFixed(digits);
  };
};

exports.unsafeToExponential = function (digits) {
  return function (n) {
    return n.toExponential(digits);
  };
};

exports.unsafeToPrecision = function (digits) {
  return function (n) {
    return n.toPrecision(digits);
  };
};

exports.unsafeDecodeURI = decodeURI;
exports.unsafeEncodeURI = encodeURI;
exports.unsafeDecodeURIComponent = decodeURIComponent;
exports.unsafeEncodeURIComponent = encodeURIComponent;
},{}],"../output/Global.Unsafe/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

module.exports = {
  unsafeStringify: $foreign.unsafeStringify,
  unsafeToFixed: $foreign.unsafeToFixed,
  unsafeToExponential: $foreign.unsafeToExponential,
  unsafeToPrecision: $foreign.unsafeToPrecision,
  unsafeDecodeURI: $foreign.unsafeDecodeURI,
  unsafeEncodeURI: $foreign.unsafeEncodeURI,
  unsafeDecodeURIComponent: $foreign.unsafeDecodeURIComponent,
  unsafeEncodeURIComponent: $foreign.unsafeEncodeURIComponent
};
},{"./foreign.js":"../output/Global.Unsafe/foreign.js"}],"../output/Foreign.Generic/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Generic_Rep = require("../Data.Generic.Rep/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Foreign_Generic_Class = require("../Foreign.Generic.Class/index.js");

var Foreign_JSON = require("../Foreign.JSON/index.js");

var Global_Unsafe = require("../Global.Unsafe/index.js");

var genericEncode = function genericEncode(dictGeneric) {
  return function (dictGenericEncode) {
    return function (opts) {
      var $10 = Foreign_Generic_Class.encodeOpts(dictGenericEncode)(opts);
      var $11 = Data_Generic_Rep.from(dictGeneric);
      return function ($12) {
        return $10($11($12));
      };
    };
  };
};

var genericEncodeJSON = function genericEncodeJSON(dictGeneric) {
  return function (dictGenericEncode) {
    return function (opts) {
      var $13 = genericEncode(dictGeneric)(dictGenericEncode)(opts);
      return function ($14) {
        return Global_Unsafe.unsafeStringify($13($14));
      };
    };
  };
};

var genericDecode = function genericDecode(dictGeneric) {
  return function (dictGenericDecode) {
    return function (opts) {
      var $15 = Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Data_Generic_Rep.to(dictGeneric));
      var $16 = Foreign_Generic_Class.decodeOpts(dictGenericDecode)(opts);
      return function ($17) {
        return $15($16($17));
      };
    };
  };
};

var genericDecodeJSON = function genericDecodeJSON(dictGeneric) {
  return function (dictGenericDecode) {
    return function (opts) {
      return Control_Bind.composeKleisliFlipped(Control_Monad_Except_Trans.bindExceptT(Data_Identity.monadIdentity))(genericDecode(dictGeneric)(dictGenericDecode)(opts))(Foreign_JSON.parseJSON);
    };
  };
};

var encodeJSON = function encodeJSON(dictEncode) {
  var $18 = Foreign_Generic_Class.encode(dictEncode);
  return function ($19) {
    return Global_Unsafe.unsafeStringify($18($19));
  };
};

var decodeJSON = function decodeJSON(dictDecode) {
  return Foreign_JSON.decodeJSONWith(Foreign_Generic_Class.decode(dictDecode));
};

module.exports = {
  genericDecode: genericDecode,
  genericEncode: genericEncode,
  decodeJSON: decodeJSON,
  encodeJSON: encodeJSON,
  genericDecodeJSON: genericDecodeJSON,
  genericEncodeJSON: genericEncodeJSON
};
},{"../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Generic.Rep/index.js":"../output/Data.Generic.Rep/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Foreign.Generic.Class/index.js":"../output/Foreign.Generic.Class/index.js","../Foreign.JSON/index.js":"../output/Foreign.JSON/index.js","../Global.Unsafe/index.js":"../output/Global.Unsafe/index.js"}],"../output/Browser.Utils/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Monad_Except = require("../Control.Monad.Except/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Effect = require("../Effect/index.js");

var Effect_Exception = require("../Effect.Exception/index.js");

var Foreign = require("../Foreign/index.js");

var Foreign_Generic = require("../Foreign.Generic/index.js");

var Foreign_Generic_Class = require("../Foreign.Generic.Class/index.js");

var Listener2 = function Listener2(x) {
  return x;
};

var Listener = function Listener(x) {
  return x;
};

var unwrapForeign = function unwrapForeign(dictGeneric) {
  return function (dictGenericDecode) {
    return function (d) {
      var v = Control_Monad_Except.runExcept(Foreign_Generic.genericDecode(dictGeneric)(dictGenericDecode)({
        sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
        unwrapSingleConstructors: true,
        unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
        fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
      })(d));

      if (v instanceof Data_Either.Left) {
        return Effect_Exception["throw"](Data_Foldable.intercalate(Data_List_Types.foldableNonEmptyList)(Data_Monoid.monoidString)(", ")(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Foreign.renderForeignError)(v.value0)));
      }

      ;

      if (v instanceof Data_Either.Right) {
        return Control_Applicative.pure(Effect.applicativeEffect)(v.value0);
      }

      ;
      throw new Error("Failed pattern match at Browser.Utils (line 45, column 19 - line 47, column 24): " + [v.constructor.name]);
    };
  };
};

module.exports = {
  unwrapForeign: unwrapForeign,
  mkListenerUnit: $foreign.mkListenerUnit,
  mkListenerOne: $foreign.mkListenerOne,
  mkListenerTwo: $foreign.mkListenerTwo
};
},{"./foreign.js":"../output/Browser.Utils/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Monad.Except/index.js":"../output/Control.Monad.Except/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Effect/index.js":"../output/Effect/index.js","../Effect.Exception/index.js":"../output/Effect.Exception/index.js","../Foreign/index.js":"../output/Foreign/index.js","../Foreign.Generic/index.js":"../output/Foreign.Generic/index.js","../Foreign.Generic.Class/index.js":"../output/Foreign.Generic.Class/index.js"}],"../output/Effect.Console/foreign.js":[function(require,module,exports) {
"use strict";

exports.log = function (s) {
  return function () {
    console.log(s);
    return {};
  };
};

exports.warn = function (s) {
  return function () {
    console.warn(s);
    return {};
  };
};

exports.error = function (s) {
  return function () {
    console.error(s);
    return {};
  };
};

exports.info = function (s) {
  return function () {
    console.info(s);
    return {};
  };
};

exports.time = function (s) {
  return function () {
    console.time(s);
    return {};
  };
};

exports.timeLog = function (s) {
  return function () {
    console.timeLog(s);
    return {};
  };
};

exports.timeEnd = function (s) {
  return function () {
    console.timeEnd(s);
    return {};
  };
};

exports.clear = function () {
  console.clear();
  return {};
};
},{}],"../output/Effect.Console/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Show = require("../Data.Show/index.js");

var warnShow = function warnShow(dictShow) {
  return function (a) {
    return $foreign.warn(Data_Show.show(dictShow)(a));
  };
};

var logShow = function logShow(dictShow) {
  return function (a) {
    return $foreign.log(Data_Show.show(dictShow)(a));
  };
};

var infoShow = function infoShow(dictShow) {
  return function (a) {
    return $foreign.info(Data_Show.show(dictShow)(a));
  };
};

var errorShow = function errorShow(dictShow) {
  return function (a) {
    return $foreign.error(Data_Show.show(dictShow)(a));
  };
};

module.exports = {
  logShow: logShow,
  warnShow: warnShow,
  errorShow: errorShow,
  infoShow: infoShow,
  log: $foreign.log,
  warn: $foreign.warn,
  error: $foreign.error,
  info: $foreign.info,
  time: $foreign.time,
  timeLog: $foreign.timeLog,
  timeEnd: $foreign.timeEnd,
  clear: $foreign.clear
};
},{"./foreign.js":"../output/Effect.Console/foreign.js","../Data.Show/index.js":"../output/Data.Show/index.js"}],"../output/Browser.Runtime/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Browser_Utils = require("../Browser.Utils/index.js");

var Control_Monad_Except = require("../Control.Monad.Except/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Effect_Console = require("../Effect.Console/index.js");

var Foreign = require("../Foreign/index.js");

var Foreign_Generic = require("../Foreign.Generic/index.js");

var Foreign_Generic_Class = require("../Foreign.Generic.Class/index.js");

var postMessageJson = function postMessageJson(dictGeneric) {
  return function (dictGenericEncode) {
    return function (port) {
      return function (d) {
        return $foreign.postMessage(port)(Foreign_Generic.genericEncodeJSON(dictGeneric)(dictGenericEncode)({
          sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
          unwrapSingleConstructors: true,
          unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
          fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
        })(d));
      };
    };
  };
};

var onMessageJsonAddListener = function onMessageJsonAddListener(dictGeneric) {
  return function (dictGenericDecode) {
    return function (port) {
      return function (f) {
        var listener = function listener(msg) {
          var v = Control_Monad_Except.runExcept(Foreign_Generic.genericDecodeJSON(dictGeneric)(dictGenericDecode)({
            sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
            unwrapSingleConstructors: true,
            unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
            fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
          })(msg));

          if (v instanceof Data_Either.Left) {
            return function __do() {
              Effect_Console.error("error while trying to parse message: " + Data_Foldable.intercalate(Data_List_Types.foldableNonEmptyList)(Data_Monoid.monoidString)(", ")(Data_Functor.map(Data_List_Types.functorNonEmptyList)(Foreign.renderForeignError)(v.value0)))();
              return Effect_Console.error("message was " + msg)();
            };
          }

          ;

          if (v instanceof Data_Either.Right) {
            return f(v.value0);
          }

          ;
          throw new Error("Failed pattern match at Browser.Runtime (line 46, column 24 - line 50, column 32): " + [v.constructor.name]);
        };

        return function __do() {
          var jsonLst = Browser_Utils.mkListenerOne(listener)();
          $foreign.onMessageAddListener(port)(jsonLst)();
          return jsonLst;
        };
      };
    };
  };
};

var eqPort = new Data_Eq.Eq($foreign.portEquality);
module.exports = {
  postMessageJson: postMessageJson,
  onMessageJsonAddListener: onMessageJsonAddListener,
  eqPort: eqPort,
  connect: $foreign.connect,
  onConnectAddListener: $foreign.onConnectAddListener,
  portOnDisconnect: $foreign.portOnDisconnect,
  postMessage: $foreign.postMessage,
  onMessageAddListener: $foreign.onMessageAddListener,
  onMessageRemoveListener: $foreign.onMessageRemoveListener
};
},{"./foreign.js":"../output/Browser.Runtime/foreign.js","../Browser.Utils/index.js":"../output/Browser.Utils/index.js","../Control.Monad.Except/index.js":"../output/Control.Monad.Except/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Effect.Console/index.js":"../output/Effect.Console/index.js","../Foreign/index.js":"../output/Foreign/index.js","../Foreign.Generic/index.js":"../output/Foreign.Generic/index.js","../Foreign.Generic.Class/index.js":"../output/Foreign.Generic.Class/index.js"}],"../output/Browser.Tabs/foreign.js":[function(require,module,exports) {
"use strict";

exports.queryImpl = function () {
  return browser.tabs.query({});
};
},{}],"../output/Control.Promise/foreign.js":[function(require,module,exports) {
// module Control.Promise
exports.promise = function (f) {
  return function () {
    return new Promise(function (success, error) {
      var succF = function succF(s) {
        return function () {
          return success(s);
        };
      };

      var failF = function failF(s) {
        return function () {
          return error(s);
        };
      }; // This indicates the aff was wrong?


      try {
        f(succF)(failF)();
      } catch (e) {
        error(e);
      }
    });
  };
};

exports.thenImpl = function (promise) {
  return function (errCB) {
    return function (succCB) {
      return function () {
        promise.then(succCB, errCB);
      };
    };
  };
};
},{}],"../output/Effect.Aff/foreign.js":[function(require,module,exports) {
/* globals setImmediate, clearImmediate, setTimeout, clearTimeout */

/* jshint -W083, -W098, -W003 */
"use strict";

var Aff = function () {
  // A unique value for empty.
  var EMPTY = {};
  /*
   An awkward approximation. We elide evidence we would otherwise need in PS for
  efficiency sake.
   data Aff eff a
    = Pure a
    | Throw Error
    | Catch (Aff eff a) (Error -> Aff eff a)
    | Sync (Eff eff a)
    | Async ((Either Error a -> Eff eff Unit) -> Eff eff (Canceler eff))
    | forall b. Bind (Aff eff b) (b -> Aff eff a)
    | forall b. Bracket (Aff eff b) (BracketConditions eff b) (b -> Aff eff a)
    | forall b. Fork Boolean (Aff eff b) ?(Fiber eff b -> a)
    | Sequential (ParAff aff a)
   */

  var PURE = "Pure";
  var THROW = "Throw";
  var CATCH = "Catch";
  var SYNC = "Sync";
  var ASYNC = "Async";
  var BIND = "Bind";
  var BRACKET = "Bracket";
  var FORK = "Fork";
  var SEQ = "Sequential";
  /*
   data ParAff eff a
    = forall b. Map (b -> a) (ParAff eff b)
    | forall b. Apply (ParAff eff (b -> a)) (ParAff eff b)
    | Alt (ParAff eff a) (ParAff eff a)
    | ?Par (Aff eff a)
   */

  var MAP = "Map";
  var APPLY = "Apply";
  var ALT = "Alt"; // Various constructors used in interpretation

  var CONS = "Cons"; // Cons-list, for stacks

  var RESUME = "Resume"; // Continue indiscriminately

  var RELEASE = "Release"; // Continue with bracket finalizers

  var FINALIZER = "Finalizer"; // A non-interruptible effect

  var FINALIZED = "Finalized"; // Marker for finalization

  var FORKED = "Forked"; // Reference to a forked fiber, with resumption stack

  var FIBER = "Fiber"; // Actual fiber reference

  var THUNK = "Thunk"; // Primed effect, ready to invoke

  function Aff(tag, _1, _2, _3) {
    this.tag = tag;
    this._1 = _1;
    this._2 = _2;
    this._3 = _3;
  }

  function AffCtr(tag) {
    var fn = function fn(_1, _2, _3) {
      return new Aff(tag, _1, _2, _3);
    };

    fn.tag = tag;
    return fn;
  }

  function nonCanceler(error) {
    return new Aff(PURE, void 0);
  }

  function runEff(eff) {
    try {
      eff();
    } catch (error) {
      setTimeout(function () {
        throw error;
      }, 0);
    }
  }

  function runSync(left, right, eff) {
    try {
      return right(eff());
    } catch (error) {
      return left(error);
    }
  }

  function runAsync(left, eff, k) {
    try {
      return eff(k)();
    } catch (error) {
      k(left(error))();
      return nonCanceler;
    }
  }

  var Scheduler = function () {
    var limit = 1024;
    var size = 0;
    var ix = 0;
    var queue = new Array(limit);
    var draining = false;

    function drain() {
      var thunk;
      draining = true;

      while (size !== 0) {
        size--;
        thunk = queue[ix];
        queue[ix] = void 0;
        ix = (ix + 1) % limit;
        thunk();
      }

      draining = false;
    }

    return {
      isDraining: function isDraining() {
        return draining;
      },
      enqueue: function enqueue(cb) {
        var i, tmp;

        if (size === limit) {
          tmp = draining;
          drain();
          draining = tmp;
        }

        queue[(ix + size) % limit] = cb;
        size++;

        if (!draining) {
          drain();
        }
      }
    };
  }();

  function Supervisor(util) {
    var fibers = {};
    var fiberId = 0;
    var count = 0;
    return {
      register: function register(fiber) {
        var fid = fiberId++;
        fiber.onComplete({
          rethrow: true,
          handler: function handler(result) {
            return function () {
              count--;
              delete fibers[fid];
            };
          }
        })();
        fibers[fid] = fiber;
        count++;
      },
      isEmpty: function isEmpty() {
        return count === 0;
      },
      killAll: function killAll(killError, cb) {
        return function () {
          if (count === 0) {
            return cb();
          }

          var killCount = 0;
          var kills = {};

          function kill(fid) {
            kills[fid] = fibers[fid].kill(killError, function (result) {
              return function () {
                delete kills[fid];
                killCount--;

                if (util.isLeft(result) && util.fromLeft(result)) {
                  setTimeout(function () {
                    throw util.fromLeft(result);
                  }, 0);
                }

                if (killCount === 0) {
                  cb();
                }
              };
            })();
          }

          for (var k in fibers) {
            if (fibers.hasOwnProperty(k)) {
              killCount++;
              kill(k);
            }
          }

          fibers = {};
          fiberId = 0;
          count = 0;
          return function (error) {
            return new Aff(SYNC, function () {
              for (var k in kills) {
                if (kills.hasOwnProperty(k)) {
                  kills[k]();
                }
              }
            });
          };
        };
      }
    };
  } // Fiber state machine


  var SUSPENDED = 0; // Suspended, pending a join.

  var CONTINUE = 1; // Interpret the next instruction.

  var STEP_BIND = 2; // Apply the next bind.

  var STEP_RESULT = 3; // Handle potential failure from a result.

  var PENDING = 4; // An async effect is running.

  var RETURN = 5; // The current stack has returned.

  var COMPLETED = 6; // The entire fiber has completed.

  function Fiber(util, supervisor, aff) {
    // Monotonically increasing tick, increased on each asynchronous turn.
    var runTick = 0; // The current branch of the state machine.

    var status = SUSPENDED; // The current point of interest for the state machine branch.

    var step = aff; // Successful step

    var fail = null; // Failure step

    var interrupt = null; // Asynchronous interrupt
    // Stack of continuations for the current fiber.

    var bhead = null;
    var btail = null; // Stack of attempts and finalizers for error recovery. Every `Cons` is also
    // tagged with current `interrupt` state. We use this to track which items
    // should be ignored or evaluated as a result of a kill.

    var attempts = null; // A special state is needed for Bracket, because it cannot be killed. When
    // we enter a bracket acquisition or finalizer, we increment the counter,
    // and then decrement once complete.

    var bracketCount = 0; // Each join gets a new id so they can be revoked.

    var joinId = 0;
    var joins = null;
    var rethrow = true; // Each invocation of `run` requires a tick. When an asynchronous effect is
    // resolved, we must check that the local tick coincides with the fiber
    // tick before resuming. This prevents multiple async continuations from
    // accidentally resuming the same fiber. A common example may be invoking
    // the provided callback in `makeAff` more than once, but it may also be an
    // async effect resuming after the fiber was already cancelled.

    function _run(localRunTick) {
      var tmp, result, attempt;

      while (true) {
        tmp = null;
        result = null;
        attempt = null;

        switch (status) {
          case STEP_BIND:
            status = CONTINUE;

            try {
              step = bhead(step);

              if (btail === null) {
                bhead = null;
              } else {
                bhead = btail._1;
                btail = btail._2;
              }
            } catch (e) {
              status = RETURN;
              fail = util.left(e);
              step = null;
            }

            break;

          case STEP_RESULT:
            if (util.isLeft(step)) {
              status = RETURN;
              fail = step;
              step = null;
            } else if (bhead === null) {
              status = RETURN;
            } else {
              status = STEP_BIND;
              step = util.fromRight(step);
            }

            break;

          case CONTINUE:
            switch (step.tag) {
              case BIND:
                if (bhead) {
                  btail = new Aff(CONS, bhead, btail);
                }

                bhead = step._2;
                status = CONTINUE;
                step = step._1;
                break;

              case PURE:
                if (bhead === null) {
                  status = RETURN;
                  step = util.right(step._1);
                } else {
                  status = STEP_BIND;
                  step = step._1;
                }

                break;

              case SYNC:
                status = STEP_RESULT;
                step = runSync(util.left, util.right, step._1);
                break;

              case ASYNC:
                status = PENDING;
                step = runAsync(util.left, step._1, function (result) {
                  return function () {
                    if (runTick !== localRunTick) {
                      return;
                    }

                    runTick++;
                    Scheduler.enqueue(function () {
                      // It's possible to interrupt the fiber between enqueuing and
                      // resuming, so we need to check that the runTick is still
                      // valid.
                      if (runTick !== localRunTick + 1) {
                        return;
                      }

                      status = STEP_RESULT;
                      step = result;

                      _run(runTick);
                    });
                  };
                });
                return;

              case THROW:
                status = RETURN;
                fail = util.left(step._1);
                step = null;
                break;
              // Enqueue the Catch so that we can call the error handler later on
              // in case of an exception.

              case CATCH:
                if (bhead === null) {
                  attempts = new Aff(CONS, step, attempts, interrupt);
                } else {
                  attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);
                }

                bhead = null;
                btail = null;
                status = CONTINUE;
                step = step._1;
                break;
              // Enqueue the Bracket so that we can call the appropriate handlers
              // after resource acquisition.

              case BRACKET:
                bracketCount++;

                if (bhead === null) {
                  attempts = new Aff(CONS, step, attempts, interrupt);
                } else {
                  attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);
                }

                bhead = null;
                btail = null;
                status = CONTINUE;
                step = step._1;
                break;

              case FORK:
                status = STEP_RESULT;
                tmp = Fiber(util, supervisor, step._2);

                if (supervisor) {
                  supervisor.register(tmp);
                }

                if (step._1) {
                  tmp.run();
                }

                step = util.right(tmp);
                break;

              case SEQ:
                status = CONTINUE;
                step = sequential(util, supervisor, step._1);
                break;
            }

            break;

          case RETURN:
            bhead = null;
            btail = null; // If the current stack has returned, and we have no other stacks to
            // resume or finalizers to run, the fiber has halted and we can
            // invoke all join callbacks. Otherwise we need to resume.

            if (attempts === null) {
              status = COMPLETED;
              step = interrupt || fail || step;
            } else {
              // The interrupt status for the enqueued item.
              tmp = attempts._3;
              attempt = attempts._1;
              attempts = attempts._2;

              switch (attempt.tag) {
                // We cannot recover from an unmasked interrupt. Otherwise we should
                // continue stepping, or run the exception handler if an exception
                // was raised.
                case CATCH:
                  // We should compare the interrupt status as well because we
                  // only want it to apply if there has been an interrupt since
                  // enqueuing the catch.
                  if (interrupt && interrupt !== tmp && bracketCount === 0) {
                    status = RETURN;
                  } else if (fail) {
                    status = CONTINUE;
                    step = attempt._2(util.fromLeft(fail));
                    fail = null;
                  }

                  break;
                // We cannot resume from an unmasked interrupt or exception.

                case RESUME:
                  // As with Catch, we only want to ignore in the case of an
                  // interrupt since enqueing the item.
                  if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {
                    status = RETURN;
                  } else {
                    bhead = attempt._1;
                    btail = attempt._2;
                    status = STEP_BIND;
                    step = util.fromRight(step);
                  }

                  break;
                // If we have a bracket, we should enqueue the handlers,
                // and continue with the success branch only if the fiber has
                // not been interrupted. If the bracket acquisition failed, we
                // should not run either.

                case BRACKET:
                  bracketCount--;

                  if (fail === null) {
                    result = util.fromRight(step); // We need to enqueue the Release with the same interrupt
                    // status as the Bracket that is initiating it.

                    attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp); // We should only coninue as long as the interrupt status has not changed or
                    // we are currently within a non-interruptable finalizer.

                    if (interrupt === tmp || bracketCount > 0) {
                      status = CONTINUE;
                      step = attempt._3(result);
                    }
                  }

                  break;
                // Enqueue the appropriate handler. We increase the bracket count
                // because it should not be cancelled.

                case RELEASE:
                  attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);
                  status = CONTINUE; // It has only been killed if the interrupt status has changed
                  // since we enqueued the item, and the bracket count is 0. If the
                  // bracket count is non-zero then we are in a masked state so it's
                  // impossible to be killed.

                  if (interrupt && interrupt !== tmp && bracketCount === 0) {
                    step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);
                  } else if (fail) {
                    step = attempt._1.failed(util.fromLeft(fail))(attempt._2);
                  } else {
                    step = attempt._1.completed(util.fromRight(step))(attempt._2);
                  }

                  fail = null;
                  bracketCount++;
                  break;

                case FINALIZER:
                  bracketCount++;
                  attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);
                  status = CONTINUE;
                  step = attempt._1;
                  break;

                case FINALIZED:
                  bracketCount--;
                  status = RETURN;
                  step = attempt._1;
                  fail = attempt._2;
                  break;
              }
            }

            break;

          case COMPLETED:
            for (var k in joins) {
              if (joins.hasOwnProperty(k)) {
                rethrow = rethrow && joins[k].rethrow;
                runEff(joins[k].handler(step));
              }
            }

            joins = null; // If we have an interrupt and a fail, then the thread threw while
            // running finalizers. This should always rethrow in a fresh stack.

            if (interrupt && fail) {
              setTimeout(function () {
                throw util.fromLeft(fail);
              }, 0); // If we have an unhandled exception, and no other fiber has joined
              // then we need to throw the exception in a fresh stack.
            } else if (util.isLeft(step) && rethrow) {
              setTimeout(function () {
                // Guard on reathrow because a completely synchronous fiber can
                // still have an observer which was added after-the-fact.
                if (rethrow) {
                  throw util.fromLeft(step);
                }
              }, 0);
            }

            return;

          case SUSPENDED:
            status = CONTINUE;
            break;

          case PENDING:
            return;
        }
      }
    }

    function onComplete(join) {
      return function () {
        if (status === COMPLETED) {
          rethrow = rethrow && join.rethrow;
          join.handler(step)();
          return function () {};
        }

        var jid = joinId++;
        joins = joins || {};
        joins[jid] = join;
        return function () {
          if (joins !== null) {
            delete joins[jid];
          }
        };
      };
    }

    function kill(error, cb) {
      return function () {
        if (status === COMPLETED) {
          cb(util.right(void 0))();
          return function () {};
        }

        var canceler = onComplete({
          rethrow: false,
          handler: function handler()
          /* unused */
          {
            return cb(util.right(void 0));
          }
        })();

        switch (status) {
          case SUSPENDED:
            interrupt = util.left(error);
            status = COMPLETED;
            step = interrupt;

            _run(runTick);

            break;

          case PENDING:
            if (interrupt === null) {
              interrupt = util.left(error);
            }

            if (bracketCount === 0) {
              if (status === PENDING) {
                attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);
              }

              status = RETURN;
              step = null;
              fail = null;

              _run(++runTick);
            }

            break;

          default:
            if (interrupt === null) {
              interrupt = util.left(error);
            }

            if (bracketCount === 0) {
              status = RETURN;
              step = null;
              fail = null;
            }

        }

        return canceler;
      };
    }

    function join(cb) {
      return function () {
        var canceler = onComplete({
          rethrow: false,
          handler: cb
        })();

        if (status === SUSPENDED) {
          _run(runTick);
        }

        return canceler;
      };
    }

    return {
      kill: kill,
      join: join,
      onComplete: onComplete,
      isSuspended: function isSuspended() {
        return status === SUSPENDED;
      },
      run: function run() {
        if (status === SUSPENDED) {
          if (!Scheduler.isDraining()) {
            Scheduler.enqueue(function () {
              _run(runTick);
            });
          } else {
            _run(runTick);
          }
        }
      }
    };
  }

  function runPar(util, supervisor, par, cb) {
    // Table of all forked fibers.
    var fiberId = 0;
    var fibers = {}; // Table of currently running cancelers, as a product of `Alt` behavior.

    var killId = 0;
    var kills = {}; // Error used for early cancelation on Alt branches.

    var early = new Error("[ParAff] Early exit"); // Error used to kill the entire tree.

    var interrupt = null; // The root pointer of the tree.

    var root = EMPTY; // Walks a tree, invoking all the cancelers. Returns the table of pending
    // cancellation fibers.

    function kill(error, par, cb) {
      var step = par;
      var head = null;
      var tail = null;
      var count = 0;
      var kills = {};
      var tmp, kid;

      loop: while (true) {
        tmp = null;

        switch (step.tag) {
          case FORKED:
            if (step._3 === EMPTY) {
              tmp = fibers[step._1];
              kills[count++] = tmp.kill(error, function (result) {
                return function () {
                  count--;

                  if (count === 0) {
                    cb(result)();
                  }
                };
              });
            } // Terminal case.


            if (head === null) {
              break loop;
            } // Go down the right side of the tree.


            step = head._2;

            if (tail === null) {
              head = null;
            } else {
              head = tail._1;
              tail = tail._2;
            }

            break;

          case MAP:
            step = step._2;
            break;

          case APPLY:
          case ALT:
            if (head) {
              tail = new Aff(CONS, head, tail);
            }

            head = step;
            step = step._1;
            break;
        }
      }

      if (count === 0) {
        cb(util.right(void 0))();
      } else {
        // Run the cancelation effects. We alias `count` because it's mutable.
        kid = 0;
        tmp = count;

        for (; kid < tmp; kid++) {
          kills[kid] = kills[kid]();
        }
      }

      return kills;
    } // When a fiber resolves, we need to bubble back up the tree with the
    // result, computing the applicative nodes.


    function join(result, head, tail) {
      var fail, step, lhs, rhs, tmp, kid;

      if (util.isLeft(result)) {
        fail = result;
        step = null;
      } else {
        step = result;
        fail = null;
      }

      loop: while (true) {
        lhs = null;
        rhs = null;
        tmp = null;
        kid = null; // We should never continue if the entire tree has been interrupted.

        if (interrupt !== null) {
          return;
        } // We've made it all the way to the root of the tree, which means
        // the tree has fully evaluated.


        if (head === null) {
          cb(fail || step)();
          return;
        } // The tree has already been computed, so we shouldn't try to do it
        // again. This should never happen.
        // TODO: Remove this?


        if (head._3 !== EMPTY) {
          return;
        }

        switch (head.tag) {
          case MAP:
            if (fail === null) {
              head._3 = util.right(head._1(util.fromRight(step)));
              step = head._3;
            } else {
              head._3 = fail;
            }

            break;

          case APPLY:
            lhs = head._1._3;
            rhs = head._2._3; // If we have a failure we should kill the other side because we
            // can't possible yield a result anymore.

            if (fail) {
              head._3 = fail;
              tmp = true;
              kid = killId++;
              kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function ()
              /* unused */
              {
                return function () {
                  delete kills[kid];

                  if (tmp) {
                    tmp = false;
                  } else if (tail === null) {
                    join(fail, null, null);
                  } else {
                    join(fail, tail._1, tail._2);
                  }
                };
              });

              if (tmp) {
                tmp = false;
                return;
              }
            } else if (lhs === EMPTY || rhs === EMPTY) {
              // We can only proceed if both sides have resolved.
              return;
            } else {
              step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));
              head._3 = step;
            }

            break;

          case ALT:
            lhs = head._1._3;
            rhs = head._2._3; // We can only proceed if both have resolved or we have a success

            if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {
              return;
            } // If both sides resolve with an error, we should continue with the
            // first error


            if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {
              fail = step === lhs ? rhs : lhs;
              step = null;
              head._3 = fail;
            } else {
              head._3 = step;
              tmp = true;
              kid = killId++; // Once a side has resolved, we need to cancel the side that is still
              // pending before we can continue.

              kills[kid] = kill(early, step === lhs ? head._2 : head._1, function ()
              /* unused */
              {
                return function () {
                  delete kills[kid];

                  if (tmp) {
                    tmp = false;
                  } else if (tail === null) {
                    join(step, null, null);
                  } else {
                    join(step, tail._1, tail._2);
                  }
                };
              });

              if (tmp) {
                tmp = false;
                return;
              }
            }

            break;
        }

        if (tail === null) {
          head = null;
        } else {
          head = tail._1;
          tail = tail._2;
        }
      }
    }

    function resolve(fiber) {
      return function (result) {
        return function () {
          delete fibers[fiber._1];
          fiber._3 = result;
          join(result, fiber._2._1, fiber._2._2);
        };
      };
    } // Walks the applicative tree, substituting non-applicative nodes with
    // `FORKED` nodes. In this tree, all applicative nodes use the `_3` slot
    // as a mutable slot for memoization. In an unresolved state, the `_3`
    // slot is `EMPTY`. In the cases of `ALT` and `APPLY`, we always walk
    // the left side first, because both operations are left-associative. As
    // we `RETURN` from those branches, we then walk the right side.


    function run() {
      var status = CONTINUE;
      var step = par;
      var head = null;
      var tail = null;
      var tmp, fid;

      loop: while (true) {
        tmp = null;
        fid = null;

        switch (status) {
          case CONTINUE:
            switch (step.tag) {
              case MAP:
                if (head) {
                  tail = new Aff(CONS, head, tail);
                }

                head = new Aff(MAP, step._1, EMPTY, EMPTY);
                step = step._2;
                break;

              case APPLY:
                if (head) {
                  tail = new Aff(CONS, head, tail);
                }

                head = new Aff(APPLY, EMPTY, step._2, EMPTY);
                step = step._1;
                break;

              case ALT:
                if (head) {
                  tail = new Aff(CONS, head, tail);
                }

                head = new Aff(ALT, EMPTY, step._2, EMPTY);
                step = step._1;
                break;

              default:
                // When we hit a leaf value, we suspend the stack in the `FORKED`.
                // When the fiber resolves, it can bubble back up the tree.
                fid = fiberId++;
                status = RETURN;
                tmp = step;
                step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);
                tmp = Fiber(util, supervisor, tmp);
                tmp.onComplete({
                  rethrow: false,
                  handler: resolve(step)
                })();
                fibers[fid] = tmp;

                if (supervisor) {
                  supervisor.register(tmp);
                }

            }

            break;

          case RETURN:
            // Terminal case, we are back at the root.
            if (head === null) {
              break loop;
            } // If we are done with the right side, we need to continue down the
            // left. Otherwise we should continue up the stack.


            if (head._1 === EMPTY) {
              head._1 = step;
              status = CONTINUE;
              step = head._2;
              head._2 = EMPTY;
            } else {
              head._2 = step;
              step = head;

              if (tail === null) {
                head = null;
              } else {
                head = tail._1;
                tail = tail._2;
              }
            }

        }
      } // Keep a reference to the tree root so it can be cancelled.


      root = step;

      for (fid = 0; fid < fiberId; fid++) {
        fibers[fid].run();
      }
    } // Cancels the entire tree. If there are already subtrees being canceled,
    // we need to first cancel those joins. We will then add fresh joins for
    // all pending branches including those that were in the process of being
    // canceled.


    function cancel(error, cb) {
      interrupt = util.left(error);
      var innerKills;

      for (var kid in kills) {
        if (kills.hasOwnProperty(kid)) {
          innerKills = kills[kid];

          for (kid in innerKills) {
            if (innerKills.hasOwnProperty(kid)) {
              innerKills[kid]();
            }
          }
        }
      }

      kills = null;
      var newKills = kill(error, root, cb);
      return function (killError) {
        return new Aff(ASYNC, function (killCb) {
          return function () {
            for (var kid in newKills) {
              if (newKills.hasOwnProperty(kid)) {
                newKills[kid]();
              }
            }

            return nonCanceler;
          };
        });
      };
    }

    run();
    return function (killError) {
      return new Aff(ASYNC, function (killCb) {
        return function () {
          return cancel(killError, killCb);
        };
      });
    };
  }

  function sequential(util, supervisor, par) {
    return new Aff(ASYNC, function (cb) {
      return function () {
        return runPar(util, supervisor, par, cb);
      };
    });
  }

  Aff.EMPTY = EMPTY;
  Aff.Pure = AffCtr(PURE);
  Aff.Throw = AffCtr(THROW);
  Aff.Catch = AffCtr(CATCH);
  Aff.Sync = AffCtr(SYNC);
  Aff.Async = AffCtr(ASYNC);
  Aff.Bind = AffCtr(BIND);
  Aff.Bracket = AffCtr(BRACKET);
  Aff.Fork = AffCtr(FORK);
  Aff.Seq = AffCtr(SEQ);
  Aff.ParMap = AffCtr(MAP);
  Aff.ParApply = AffCtr(APPLY);
  Aff.ParAlt = AffCtr(ALT);
  Aff.Fiber = Fiber;
  Aff.Supervisor = Supervisor;
  Aff.Scheduler = Scheduler;
  Aff.nonCanceler = nonCanceler;
  return Aff;
}();

exports._pure = Aff.Pure;
exports._throwError = Aff.Throw;

exports._catchError = function (aff) {
  return function (k) {
    return Aff.Catch(aff, k);
  };
};

exports._map = function (f) {
  return function (aff) {
    if (aff.tag === Aff.Pure.tag) {
      return Aff.Pure(f(aff._1));
    } else {
      return Aff.Bind(aff, function (value) {
        return Aff.Pure(f(value));
      });
    }
  };
};

exports._bind = function (aff) {
  return function (k) {
    return Aff.Bind(aff, k);
  };
};

exports._fork = function (immediate) {
  return function (aff) {
    return Aff.Fork(immediate, aff);
  };
};

exports._liftEffect = Aff.Sync;

exports._parAffMap = function (f) {
  return function (aff) {
    return Aff.ParMap(f, aff);
  };
};

exports._parAffApply = function (aff1) {
  return function (aff2) {
    return Aff.ParApply(aff1, aff2);
  };
};

exports._parAffAlt = function (aff1) {
  return function (aff2) {
    return Aff.ParAlt(aff1, aff2);
  };
};

exports.makeAff = Aff.Async;

exports.generalBracket = function (acquire) {
  return function (options) {
    return function (k) {
      return Aff.Bracket(acquire, options, k);
    };
  };
};

exports._makeFiber = function (util, aff) {
  return function () {
    return Aff.Fiber(util, null, aff);
  };
};

exports._makeSupervisedFiber = function (util, aff) {
  return function () {
    var supervisor = Aff.Supervisor(util);
    return {
      fiber: Aff.Fiber(util, supervisor, aff),
      supervisor: supervisor
    };
  };
};

exports._killAll = function (error, supervisor, cb) {
  return supervisor.killAll(error, cb);
};

exports._delay = function () {
  function setDelay(n, k) {
    if (n === 0 && typeof setImmediate !== "undefined") {
      return setImmediate(k);
    } else {
      return setTimeout(k, n);
    }
  }

  function clearDelay(n, t) {
    if (n === 0 && typeof clearImmediate !== "undefined") {
      return clearImmediate(t);
    } else {
      return clearTimeout(t);
    }
  }

  return function (right, ms) {
    return Aff.Async(function (cb) {
      return function () {
        var timer = setDelay(ms, cb(right()));
        return function () {
          return Aff.Sync(function () {
            return right(clearDelay(ms, timer));
          });
        };
      };
    });
  };
}();

exports._sequential = Aff.Seq;
},{}],"../output/Control.Monad.Cont.Trans/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Monad_Cont_Class = require("../Control.Monad.Cont.Class/index.js");

var Control_Monad_Reader_Class = require("../Control.Monad.Reader.Class/index.js");

var Control_Monad_State_Class = require("../Control.Monad.State.Class/index.js");

var Control_Monad_Trans_Class = require("../Control.Monad.Trans.Class/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var ContT = function ContT(x) {
  return x;
};

var withContT = function withContT(f) {
  return function (v) {
    return function (k) {
      return v(f(k));
    };
  };
};

var runContT = function runContT(v) {
  return function (k) {
    return v(k);
  };
};

var newtypeContT = new Data_Newtype.Newtype(function (n) {
  return n;
}, ContT);
var monadTransContT = new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) {
  return function (m) {
    return function (k) {
      return Control_Bind.bind(dictMonad.Bind1())(m)(k);
    };
  };
});

var mapContT = function mapContT(f) {
  return function (v) {
    return function (k) {
      return f(v(k));
    };
  };
};

var functorContT = function functorContT(dictFunctor) {
  return new Data_Functor.Functor(function (f) {
    return function (v) {
      return function (k) {
        return v(function (a) {
          return k(f(a));
        });
      };
    };
  });
};

var applyContT = function applyContT(dictApply) {
  return new Control_Apply.Apply(function () {
    return functorContT(dictApply.Functor0());
  }, function (v) {
    return function (v1) {
      return function (k) {
        return v(function (g) {
          return v1(function (a) {
            return k(g(a));
          });
        });
      };
    };
  });
};

var bindContT = function bindContT(dictBind) {
  return new Control_Bind.Bind(function () {
    return applyContT(dictBind.Apply0());
  }, function (v) {
    return function (k) {
      return function (k$prime) {
        return v(function (a) {
          var v1 = k(a);
          return v1(k$prime);
        });
      };
    };
  });
};

var applicativeContT = function applicativeContT(dictApplicative) {
  return new Control_Applicative.Applicative(function () {
    return applyContT(dictApplicative.Apply0());
  }, function (a) {
    return function (k) {
      return k(a);
    };
  });
};

var monadContT = function monadContT(dictMonad) {
  return new Control_Monad.Monad(function () {
    return applicativeContT(dictMonad.Applicative0());
  }, function () {
    return bindContT(dictMonad.Bind1());
  });
};

var monadAskContT = function monadAskContT(dictMonadAsk) {
  return new Control_Monad_Reader_Class.MonadAsk(function () {
    return monadContT(dictMonadAsk.Monad0());
  }, Control_Monad_Trans_Class.lift(monadTransContT)(dictMonadAsk.Monad0())(Control_Monad_Reader_Class.ask(dictMonadAsk)));
};

var monadReaderContT = function monadReaderContT(dictMonadReader) {
  return new Control_Monad_Reader_Class.MonadReader(function () {
    return monadAskContT(dictMonadReader.MonadAsk0());
  }, function (f) {
    return function (v) {
      return function (k) {
        return Control_Bind.bind(dictMonadReader.MonadAsk0().Monad0().Bind1())(Control_Monad_Reader_Class.ask(dictMonadReader.MonadAsk0()))(function (r) {
          return Control_Monad_Reader_Class.local(dictMonadReader)(f)(v(function () {
            var $43 = Control_Monad_Reader_Class.local(dictMonadReader)(Data_Function["const"](r));
            return function ($44) {
              return $43(k($44));
            };
          }()));
        });
      };
    };
  });
};

var monadContContT = function monadContContT(dictMonad) {
  return new Control_Monad_Cont_Class.MonadCont(function () {
    return monadContT(dictMonad);
  }, function (f) {
    return function (k) {
      var v = f(function (a) {
        return function (v1) {
          return k(a);
        };
      });
      return v(k);
    };
  });
};

var monadEffectContT = function monadEffectContT(dictMonadEffect) {
  return new Effect_Class.MonadEffect(function () {
    return monadContT(dictMonadEffect.Monad0());
  }, function () {
    var $45 = Control_Monad_Trans_Class.lift(monadTransContT)(dictMonadEffect.Monad0());
    var $46 = Effect_Class.liftEffect(dictMonadEffect);
    return function ($47) {
      return $45($46($47));
    };
  }());
};

var monadStateContT = function monadStateContT(dictMonadState) {
  return new Control_Monad_State_Class.MonadState(function () {
    return monadContT(dictMonadState.Monad0());
  }, function () {
    var $48 = Control_Monad_Trans_Class.lift(monadTransContT)(dictMonadState.Monad0());
    var $49 = Control_Monad_State_Class.state(dictMonadState);
    return function ($50) {
      return $48($49($50));
    };
  }());
};

module.exports = {
  ContT: ContT,
  runContT: runContT,
  mapContT: mapContT,
  withContT: withContT,
  newtypeContT: newtypeContT,
  monadContContT: monadContContT,
  functorContT: functorContT,
  applyContT: applyContT,
  applicativeContT: applicativeContT,
  bindContT: bindContT,
  monadContT: monadContT,
  monadTransContT: monadTransContT,
  monadEffectContT: monadEffectContT,
  monadAskContT: monadAskContT,
  monadReaderContT: monadReaderContT,
  monadStateContT: monadStateContT
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Monad.Cont.Class/index.js":"../output/Control.Monad.Cont.Class/index.js","../Control.Monad.Reader.Class/index.js":"../output/Control.Monad.Reader.Class/index.js","../Control.Monad.State.Class/index.js":"../output/Control.Monad.State.Class/index.js","../Control.Monad.Trans.Class/index.js":"../output/Control.Monad.Trans.Class/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js"}],"../output/Control.Monad.Maybe.Trans/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Monad_Cont_Class = require("../Control.Monad.Cont.Class/index.js");

var Control_Monad_Error_Class = require("../Control.Monad.Error.Class/index.js");

var Control_Monad_Reader_Class = require("../Control.Monad.Reader.Class/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Control_Monad_State_Class = require("../Control.Monad.State.Class/index.js");

var Control_Monad_Trans_Class = require("../Control.Monad.Trans.Class/index.js");

var Control_Monad_Writer_Class = require("../Control.Monad.Writer.Class/index.js");

var Control_MonadPlus = require("../Control.MonadPlus/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var MaybeT = function MaybeT(x) {
  return x;
};

var runMaybeT = function runMaybeT(v) {
  return v;
};

var newtypeMaybeT = new Data_Newtype.Newtype(function (n) {
  return n;
}, MaybeT);
var monadTransMaybeT = new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) {
  var $71 = Control_Monad.liftM1(dictMonad)(Data_Maybe.Just.create);
  return function ($72) {
    return MaybeT($71($72));
  };
});

var mapMaybeT = function mapMaybeT(f) {
  return function (v) {
    return f(v);
  };
};

var functorMaybeT = function functorMaybeT(dictFunctor) {
  return new Data_Functor.Functor(function (f) {
    return function (v) {
      return Data_Functor.map(dictFunctor)(Data_Functor.map(Data_Maybe.functorMaybe)(f))(v);
    };
  });
};

var monadMaybeT = function monadMaybeT(dictMonad) {
  return new Control_Monad.Monad(function () {
    return applicativeMaybeT(dictMonad);
  }, function () {
    return bindMaybeT(dictMonad);
  });
};

var bindMaybeT = function bindMaybeT(dictMonad) {
  return new Control_Bind.Bind(function () {
    return applyMaybeT(dictMonad);
  }, function (v) {
    return function (f) {
      return Control_Bind.bind(dictMonad.Bind1())(v)(function (v1) {
        if (v1 instanceof Data_Maybe.Nothing) {
          return Control_Applicative.pure(dictMonad.Applicative0())(Data_Maybe.Nothing.value);
        }

        ;

        if (v1 instanceof Data_Maybe.Just) {
          var v2 = f(v1.value0);
          return v2;
        }

        ;
        throw new Error("Failed pattern match at Control.Monad.Maybe.Trans (line 54, column 11 - line 56, column 42): " + [v1.constructor.name]);
      });
    };
  });
};

var applyMaybeT = function applyMaybeT(dictMonad) {
  return new Control_Apply.Apply(function () {
    return functorMaybeT(dictMonad.Bind1().Apply0().Functor0());
  }, Control_Monad.ap(monadMaybeT(dictMonad)));
};

var applicativeMaybeT = function applicativeMaybeT(dictMonad) {
  return new Control_Applicative.Applicative(function () {
    return applyMaybeT(dictMonad);
  }, function () {
    var $73 = Control_Applicative.pure(dictMonad.Applicative0());
    return function ($74) {
      return MaybeT($73(Data_Maybe.Just.create($74)));
    };
  }());
};

var monadAskMaybeT = function monadAskMaybeT(dictMonadAsk) {
  return new Control_Monad_Reader_Class.MonadAsk(function () {
    return monadMaybeT(dictMonadAsk.Monad0());
  }, Control_Monad_Trans_Class.lift(monadTransMaybeT)(dictMonadAsk.Monad0())(Control_Monad_Reader_Class.ask(dictMonadAsk)));
};

var monadReaderMaybeT = function monadReaderMaybeT(dictMonadReader) {
  return new Control_Monad_Reader_Class.MonadReader(function () {
    return monadAskMaybeT(dictMonadReader.MonadAsk0());
  }, function (f) {
    return mapMaybeT(Control_Monad_Reader_Class.local(dictMonadReader)(f));
  });
};

var monadContMaybeT = function monadContMaybeT(dictMonadCont) {
  return new Control_Monad_Cont_Class.MonadCont(function () {
    return monadMaybeT(dictMonadCont.Monad0());
  }, function (f) {
    return MaybeT(Control_Monad_Cont_Class.callCC(dictMonadCont)(function (c) {
      var v = f(function (a) {
        return MaybeT(c(new Data_Maybe.Just(a)));
      });
      return v;
    }));
  });
};

var monadEffectMaybe = function monadEffectMaybe(dictMonadEffect) {
  return new Effect_Class.MonadEffect(function () {
    return monadMaybeT(dictMonadEffect.Monad0());
  }, function () {
    var $75 = Control_Monad_Trans_Class.lift(monadTransMaybeT)(dictMonadEffect.Monad0());
    var $76 = Effect_Class.liftEffect(dictMonadEffect);
    return function ($77) {
      return $75($76($77));
    };
  }());
};

var monadRecMaybeT = function monadRecMaybeT(dictMonadRec) {
  return new Control_Monad_Rec_Class.MonadRec(function () {
    return monadMaybeT(dictMonadRec.Monad0());
  }, function (f) {
    var $78 = Control_Monad_Rec_Class.tailRecM(dictMonadRec)(function (a) {
      var v = f(a);
      return Control_Bind.bind(dictMonadRec.Monad0().Bind1())(v)(function (m$prime) {
        return Control_Applicative.pure(dictMonadRec.Monad0().Applicative0())(function () {
          if (m$prime instanceof Data_Maybe.Nothing) {
            return new Control_Monad_Rec_Class.Done(Data_Maybe.Nothing.value);
          }

          ;

          if (m$prime instanceof Data_Maybe.Just && m$prime.value0 instanceof Control_Monad_Rec_Class.Loop) {
            return new Control_Monad_Rec_Class.Loop(m$prime.value0.value0);
          }

          ;

          if (m$prime instanceof Data_Maybe.Just && m$prime.value0 instanceof Control_Monad_Rec_Class.Done) {
            return new Control_Monad_Rec_Class.Done(new Data_Maybe.Just(m$prime.value0.value0));
          }

          ;
          throw new Error("Failed pattern match at Control.Monad.Maybe.Trans (line 84, column 16 - line 87, column 43): " + [m$prime.constructor.name]);
        }());
      });
    });
    return function ($79) {
      return MaybeT($78($79));
    };
  });
};

var monadStateMaybeT = function monadStateMaybeT(dictMonadState) {
  return new Control_Monad_State_Class.MonadState(function () {
    return monadMaybeT(dictMonadState.Monad0());
  }, function (f) {
    return Control_Monad_Trans_Class.lift(monadTransMaybeT)(dictMonadState.Monad0())(Control_Monad_State_Class.state(dictMonadState)(f));
  });
};

var monadTellMaybeT = function monadTellMaybeT(dictMonadTell) {
  return new Control_Monad_Writer_Class.MonadTell(function () {
    return monadMaybeT(dictMonadTell.Monad0());
  }, function () {
    var $80 = Control_Monad_Trans_Class.lift(monadTransMaybeT)(dictMonadTell.Monad0());
    var $81 = Control_Monad_Writer_Class.tell(dictMonadTell);
    return function ($82) {
      return $80($81($82));
    };
  }());
};

var monadWriterMaybeT = function monadWriterMaybeT(dictMonadWriter) {
  return new Control_Monad_Writer_Class.MonadWriter(function () {
    return monadTellMaybeT(dictMonadWriter.MonadTell0());
  }, mapMaybeT(function (m) {
    return Control_Bind.bind(dictMonadWriter.MonadTell0().Monad0().Bind1())(Control_Monad_Writer_Class.listen(dictMonadWriter)(m))(function (v) {
      return Control_Applicative.pure(dictMonadWriter.MonadTell0().Monad0().Applicative0())(Data_Functor.map(Data_Maybe.functorMaybe)(function (r) {
        return new Data_Tuple.Tuple(r, v.value1);
      })(v.value0));
    });
  }), mapMaybeT(function (m) {
    return Control_Monad_Writer_Class.pass(dictMonadWriter)(Control_Bind.bind(dictMonadWriter.MonadTell0().Monad0().Bind1())(m)(function (a) {
      return Control_Applicative.pure(dictMonadWriter.MonadTell0().Monad0().Applicative0())(function () {
        if (a instanceof Data_Maybe.Nothing) {
          return new Data_Tuple.Tuple(Data_Maybe.Nothing.value, Control_Category.identity(Control_Category.categoryFn));
        }

        ;

        if (a instanceof Data_Maybe.Just) {
          return new Data_Tuple.Tuple(new Data_Maybe.Just(a.value0.value0), a.value0.value1);
        }

        ;
        throw new Error("Failed pattern match at Control.Monad.Maybe.Trans (line 121, column 10 - line 123, column 43): " + [a.constructor.name]);
      }());
    }));
  }));
};

var monadThrowMaybeT = function monadThrowMaybeT(dictMonadThrow) {
  return new Control_Monad_Error_Class.MonadThrow(function () {
    return monadMaybeT(dictMonadThrow.Monad0());
  }, function (e) {
    return Control_Monad_Trans_Class.lift(monadTransMaybeT)(dictMonadThrow.Monad0())(Control_Monad_Error_Class.throwError(dictMonadThrow)(e));
  });
};

var monadErrorMaybeT = function monadErrorMaybeT(dictMonadError) {
  return new Control_Monad_Error_Class.MonadError(function () {
    return monadThrowMaybeT(dictMonadError.MonadThrow0());
  }, function (v) {
    return function (h) {
      return MaybeT(Control_Monad_Error_Class.catchError(dictMonadError)(v)(function (a) {
        var v1 = h(a);
        return v1;
      }));
    };
  });
};

var altMaybeT = function altMaybeT(dictMonad) {
  return new Control_Alt.Alt(function () {
    return functorMaybeT(dictMonad.Bind1().Apply0().Functor0());
  }, function (v) {
    return function (v1) {
      return Control_Bind.bind(dictMonad.Bind1())(v)(function (m) {
        if (m instanceof Data_Maybe.Nothing) {
          return v1;
        }

        ;
        return Control_Applicative.pure(dictMonad.Applicative0())(m);
      });
    };
  });
};

var plusMaybeT = function plusMaybeT(dictMonad) {
  return new Control_Plus.Plus(function () {
    return altMaybeT(dictMonad);
  }, Control_Applicative.pure(dictMonad.Applicative0())(Data_Maybe.Nothing.value));
};

var alternativeMaybeT = function alternativeMaybeT(dictMonad) {
  return new Control_Alternative.Alternative(function () {
    return applicativeMaybeT(dictMonad);
  }, function () {
    return plusMaybeT(dictMonad);
  });
};

var monadZeroMaybeT = function monadZeroMaybeT(dictMonad) {
  return new Control_MonadZero.MonadZero(function () {
    return alternativeMaybeT(dictMonad);
  }, function () {
    return monadMaybeT(dictMonad);
  });
};

var monadPlusMaybeT = function monadPlusMaybeT(dictMonad) {
  return new Control_MonadPlus.MonadPlus(function () {
    return monadZeroMaybeT(dictMonad);
  });
};

module.exports = {
  MaybeT: MaybeT,
  runMaybeT: runMaybeT,
  mapMaybeT: mapMaybeT,
  newtypeMaybeT: newtypeMaybeT,
  functorMaybeT: functorMaybeT,
  applyMaybeT: applyMaybeT,
  applicativeMaybeT: applicativeMaybeT,
  bindMaybeT: bindMaybeT,
  monadMaybeT: monadMaybeT,
  monadTransMaybeT: monadTransMaybeT,
  altMaybeT: altMaybeT,
  plusMaybeT: plusMaybeT,
  alternativeMaybeT: alternativeMaybeT,
  monadPlusMaybeT: monadPlusMaybeT,
  monadZeroMaybeT: monadZeroMaybeT,
  monadRecMaybeT: monadRecMaybeT,
  monadEffectMaybe: monadEffectMaybe,
  monadContMaybeT: monadContMaybeT,
  monadThrowMaybeT: monadThrowMaybeT,
  monadErrorMaybeT: monadErrorMaybeT,
  monadAskMaybeT: monadAskMaybeT,
  monadReaderMaybeT: monadReaderMaybeT,
  monadStateMaybeT: monadStateMaybeT,
  monadTellMaybeT: monadTellMaybeT,
  monadWriterMaybeT: monadWriterMaybeT
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Monad.Cont.Class/index.js":"../output/Control.Monad.Cont.Class/index.js","../Control.Monad.Error.Class/index.js":"../output/Control.Monad.Error.Class/index.js","../Control.Monad.Reader.Class/index.js":"../output/Control.Monad.Reader.Class/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Control.Monad.State.Class/index.js":"../output/Control.Monad.State.Class/index.js","../Control.Monad.Trans.Class/index.js":"../output/Control.Monad.Trans.Class/index.js","../Control.Monad.Writer.Class/index.js":"../output/Control.Monad.Writer.Class/index.js","../Control.MonadPlus/index.js":"../output/Control.MonadPlus/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js"}],"../output/Control.Monad.Reader.Trans/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Monad_Cont_Class = require("../Control.Monad.Cont.Class/index.js");

var Control_Monad_Error_Class = require("../Control.Monad.Error.Class/index.js");

var Control_Monad_Reader_Class = require("../Control.Monad.Reader.Class/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Control_Monad_State_Class = require("../Control.Monad.State.Class/index.js");

var Control_Monad_Trans_Class = require("../Control.Monad.Trans.Class/index.js");

var Control_Monad_Writer_Class = require("../Control.Monad.Writer.Class/index.js");

var Control_MonadPlus = require("../Control.MonadPlus/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Distributive = require("../Data.Distributive/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var ReaderT = function ReaderT(x) {
  return x;
};

var withReaderT = function withReaderT(f) {
  return function (v) {
    return function ($66) {
      return v(f($66));
    };
  };
};

var runReaderT = function runReaderT(v) {
  return v;
};

var newtypeReaderT = new Data_Newtype.Newtype(function (n) {
  return n;
}, ReaderT);
var monadTransReaderT = new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) {
  return function ($67) {
    return ReaderT(Data_Function["const"]($67));
  };
});

var mapReaderT = function mapReaderT(f) {
  return function (v) {
    return function ($68) {
      return f(v($68));
    };
  };
};

var functorReaderT = function functorReaderT(dictFunctor) {
  return new Data_Functor.Functor(function () {
    var $69 = Data_Functor.map(dictFunctor);
    return function ($70) {
      return mapReaderT($69($70));
    };
  }());
};

var distributiveReaderT = function distributiveReaderT(dictDistributive) {
  return new Data_Distributive.Distributive(function () {
    return functorReaderT(dictDistributive.Functor0());
  }, function (dictFunctor) {
    return function (f) {
      var $71 = Data_Distributive.distribute(distributiveReaderT(dictDistributive))(dictFunctor);
      var $72 = Data_Functor.map(dictFunctor)(f);
      return function ($73) {
        return $71($72($73));
      };
    };
  }, function (dictFunctor) {
    return function (a) {
      return function (e) {
        return Data_Distributive.collect(dictDistributive)(dictFunctor)(function (r) {
          return r(e);
        })(a);
      };
    };
  });
};

var applyReaderT = function applyReaderT(dictApply) {
  return new Control_Apply.Apply(function () {
    return functorReaderT(dictApply.Functor0());
  }, function (v) {
    return function (v1) {
      return function (r) {
        return Control_Apply.apply(dictApply)(v(r))(v1(r));
      };
    };
  });
};

var bindReaderT = function bindReaderT(dictBind) {
  return new Control_Bind.Bind(function () {
    return applyReaderT(dictBind.Apply0());
  }, function (v) {
    return function (k) {
      return function (r) {
        return Control_Bind.bind(dictBind)(v(r))(function (a) {
          var v1 = k(a);
          return v1(r);
        });
      };
    };
  });
};

var semigroupReaderT = function semigroupReaderT(dictApply) {
  return function (dictSemigroup) {
    return new Data_Semigroup.Semigroup(Control_Apply.lift2(applyReaderT(dictApply))(Data_Semigroup.append(dictSemigroup)));
  };
};

var applicativeReaderT = function applicativeReaderT(dictApplicative) {
  return new Control_Applicative.Applicative(function () {
    return applyReaderT(dictApplicative.Apply0());
  }, function () {
    var $74 = Control_Applicative.pure(dictApplicative);
    return function ($75) {
      return ReaderT(Data_Function["const"]($74($75)));
    };
  }());
};

var monadReaderT = function monadReaderT(dictMonad) {
  return new Control_Monad.Monad(function () {
    return applicativeReaderT(dictMonad.Applicative0());
  }, function () {
    return bindReaderT(dictMonad.Bind1());
  });
};

var monadAskReaderT = function monadAskReaderT(dictMonad) {
  return new Control_Monad_Reader_Class.MonadAsk(function () {
    return monadReaderT(dictMonad);
  }, Control_Applicative.pure(dictMonad.Applicative0()));
};

var monadReaderReaderT = function monadReaderReaderT(dictMonad) {
  return new Control_Monad_Reader_Class.MonadReader(function () {
    return monadAskReaderT(dictMonad);
  }, withReaderT);
};

var monadContReaderT = function monadContReaderT(dictMonadCont) {
  return new Control_Monad_Cont_Class.MonadCont(function () {
    return monadReaderT(dictMonadCont.Monad0());
  }, function (f) {
    return function (r) {
      return Control_Monad_Cont_Class.callCC(dictMonadCont)(function (c) {
        var v = f(function ($76) {
          return ReaderT(Data_Function["const"](c($76)));
        });
        return v(r);
      });
    };
  });
};

var monadEffectReader = function monadEffectReader(dictMonadEffect) {
  return new Effect_Class.MonadEffect(function () {
    return monadReaderT(dictMonadEffect.Monad0());
  }, function () {
    var $77 = Control_Monad_Trans_Class.lift(monadTransReaderT)(dictMonadEffect.Monad0());
    var $78 = Effect_Class.liftEffect(dictMonadEffect);
    return function ($79) {
      return $77($78($79));
    };
  }());
};

var monadRecReaderT = function monadRecReaderT(dictMonadRec) {
  return new Control_Monad_Rec_Class.MonadRec(function () {
    return monadReaderT(dictMonadRec.Monad0());
  }, function (k) {
    return function (a) {
      var k$prime = function k$prime(r) {
        return function (a$prime) {
          var v = k(a$prime);
          return Control_Bind.bindFlipped(dictMonadRec.Monad0().Bind1())(Control_Applicative.pure(dictMonadRec.Monad0().Applicative0()))(v(r));
        };
      };

      return function (r) {
        return Control_Monad_Rec_Class.tailRecM(dictMonadRec)(k$prime(r))(a);
      };
    };
  });
};

var monadStateReaderT = function monadStateReaderT(dictMonadState) {
  return new Control_Monad_State_Class.MonadState(function () {
    return monadReaderT(dictMonadState.Monad0());
  }, function () {
    var $80 = Control_Monad_Trans_Class.lift(monadTransReaderT)(dictMonadState.Monad0());
    var $81 = Control_Monad_State_Class.state(dictMonadState);
    return function ($82) {
      return $80($81($82));
    };
  }());
};

var monadTellReaderT = function monadTellReaderT(dictMonadTell) {
  return new Control_Monad_Writer_Class.MonadTell(function () {
    return monadReaderT(dictMonadTell.Monad0());
  }, function () {
    var $83 = Control_Monad_Trans_Class.lift(monadTransReaderT)(dictMonadTell.Monad0());
    var $84 = Control_Monad_Writer_Class.tell(dictMonadTell);
    return function ($85) {
      return $83($84($85));
    };
  }());
};

var monadWriterReaderT = function monadWriterReaderT(dictMonadWriter) {
  return new Control_Monad_Writer_Class.MonadWriter(function () {
    return monadTellReaderT(dictMonadWriter.MonadTell0());
  }, mapReaderT(Control_Monad_Writer_Class.listen(dictMonadWriter)), mapReaderT(Control_Monad_Writer_Class.pass(dictMonadWriter)));
};

var monadThrowReaderT = function monadThrowReaderT(dictMonadThrow) {
  return new Control_Monad_Error_Class.MonadThrow(function () {
    return monadReaderT(dictMonadThrow.Monad0());
  }, function () {
    var $86 = Control_Monad_Trans_Class.lift(monadTransReaderT)(dictMonadThrow.Monad0());
    var $87 = Control_Monad_Error_Class.throwError(dictMonadThrow);
    return function ($88) {
      return $86($87($88));
    };
  }());
};

var monadErrorReaderT = function monadErrorReaderT(dictMonadError) {
  return new Control_Monad_Error_Class.MonadError(function () {
    return monadThrowReaderT(dictMonadError.MonadThrow0());
  }, function (v) {
    return function (h) {
      return function (r) {
        return Control_Monad_Error_Class.catchError(dictMonadError)(v(r))(function (e) {
          var v1 = h(e);
          return v1(r);
        });
      };
    };
  });
};

var monoidReaderT = function monoidReaderT(dictApplicative) {
  return function (dictMonoid) {
    return new Data_Monoid.Monoid(function () {
      return semigroupReaderT(dictApplicative.Apply0())(dictMonoid.Semigroup0());
    }, Control_Applicative.pure(applicativeReaderT(dictApplicative))(Data_Monoid.mempty(dictMonoid)));
  };
};

var altReaderT = function altReaderT(dictAlt) {
  return new Control_Alt.Alt(function () {
    return functorReaderT(dictAlt.Functor0());
  }, function (v) {
    return function (v1) {
      return function (r) {
        return Control_Alt.alt(dictAlt)(v(r))(v1(r));
      };
    };
  });
};

var plusReaderT = function plusReaderT(dictPlus) {
  return new Control_Plus.Plus(function () {
    return altReaderT(dictPlus.Alt0());
  }, Data_Function["const"](Control_Plus.empty(dictPlus)));
};

var alternativeReaderT = function alternativeReaderT(dictAlternative) {
  return new Control_Alternative.Alternative(function () {
    return applicativeReaderT(dictAlternative.Applicative0());
  }, function () {
    return plusReaderT(dictAlternative.Plus1());
  });
};

var monadZeroReaderT = function monadZeroReaderT(dictMonadZero) {
  return new Control_MonadZero.MonadZero(function () {
    return alternativeReaderT(dictMonadZero.Alternative1());
  }, function () {
    return monadReaderT(dictMonadZero.Monad0());
  });
};

var monadPlusReaderT = function monadPlusReaderT(dictMonadPlus) {
  return new Control_MonadPlus.MonadPlus(function () {
    return monadZeroReaderT(dictMonadPlus.MonadZero0());
  });
};

module.exports = {
  ReaderT: ReaderT,
  runReaderT: runReaderT,
  withReaderT: withReaderT,
  mapReaderT: mapReaderT,
  newtypeReaderT: newtypeReaderT,
  functorReaderT: functorReaderT,
  applyReaderT: applyReaderT,
  applicativeReaderT: applicativeReaderT,
  altReaderT: altReaderT,
  plusReaderT: plusReaderT,
  alternativeReaderT: alternativeReaderT,
  bindReaderT: bindReaderT,
  monadReaderT: monadReaderT,
  monadZeroReaderT: monadZeroReaderT,
  semigroupReaderT: semigroupReaderT,
  monoidReaderT: monoidReaderT,
  monadPlusReaderT: monadPlusReaderT,
  monadTransReaderT: monadTransReaderT,
  monadEffectReader: monadEffectReader,
  monadContReaderT: monadContReaderT,
  monadThrowReaderT: monadThrowReaderT,
  monadErrorReaderT: monadErrorReaderT,
  monadAskReaderT: monadAskReaderT,
  monadReaderReaderT: monadReaderReaderT,
  monadStateReaderT: monadStateReaderT,
  monadTellReaderT: monadTellReaderT,
  monadWriterReaderT: monadWriterReaderT,
  distributiveReaderT: distributiveReaderT,
  monadRecReaderT: monadRecReaderT
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Monad.Cont.Class/index.js":"../output/Control.Monad.Cont.Class/index.js","../Control.Monad.Error.Class/index.js":"../output/Control.Monad.Error.Class/index.js","../Control.Monad.Reader.Class/index.js":"../output/Control.Monad.Reader.Class/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Control.Monad.State.Class/index.js":"../output/Control.Monad.State.Class/index.js","../Control.Monad.Trans.Class/index.js":"../output/Control.Monad.Trans.Class/index.js","../Control.Monad.Writer.Class/index.js":"../output/Control.Monad.Writer.Class/index.js","../Control.MonadPlus/index.js":"../output/Control.MonadPlus/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Distributive/index.js":"../output/Data.Distributive/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js"}],"../output/Control.Monad.Writer.Trans/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Monad_Cont_Class = require("../Control.Monad.Cont.Class/index.js");

var Control_Monad_Error_Class = require("../Control.Monad.Error.Class/index.js");

var Control_Monad_Reader_Class = require("../Control.Monad.Reader.Class/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Control_Monad_State_Class = require("../Control.Monad.State.Class/index.js");

var Control_Monad_Trans_Class = require("../Control.Monad.Trans.Class/index.js");

var Control_Monad_Writer_Class = require("../Control.Monad.Writer.Class/index.js");

var Control_MonadPlus = require("../Control.MonadPlus/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var WriterT = function WriterT(x) {
  return x;
};

var runWriterT = function runWriterT(v) {
  return v;
};

var newtypeWriterT = new Data_Newtype.Newtype(function (n) {
  return n;
}, WriterT);

var monadTransWriterT = function monadTransWriterT(dictMonoid) {
  return new Control_Monad_Trans_Class.MonadTrans(function (dictMonad) {
    return function (m) {
      return Control_Bind.bind(dictMonad.Bind1())(m)(function (a) {
        return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Tuple.Tuple(a, Data_Monoid.mempty(dictMonoid)));
      });
    };
  });
};

var mapWriterT = function mapWriterT(f) {
  return function (v) {
    return f(v);
  };
};

var functorWriterT = function functorWriterT(dictFunctor) {
  return new Data_Functor.Functor(function (f) {
    return mapWriterT(Data_Functor.map(dictFunctor)(function (v) {
      return new Data_Tuple.Tuple(f(v.value0), v.value1);
    }));
  });
};

var execWriterT = function execWriterT(dictFunctor) {
  return function (v) {
    return Data_Functor.map(dictFunctor)(Data_Tuple.snd)(v);
  };
};

var applyWriterT = function applyWriterT(dictSemigroup) {
  return function (dictApply) {
    return new Control_Apply.Apply(function () {
      return functorWriterT(dictApply.Functor0());
    }, function (v) {
      return function (v1) {
        var k = function k(v3) {
          return function (v4) {
            return new Data_Tuple.Tuple(v3.value0(v4.value0), Data_Semigroup.append(dictSemigroup)(v3.value1)(v4.value1));
          };
        };

        return Control_Apply.apply(dictApply)(Data_Functor.map(dictApply.Functor0())(k)(v))(v1);
      };
    });
  };
};

var bindWriterT = function bindWriterT(dictSemigroup) {
  return function (dictBind) {
    return new Control_Bind.Bind(function () {
      return applyWriterT(dictSemigroup)(dictBind.Apply0());
    }, function (v) {
      return function (k) {
        return WriterT(Control_Bind.bind(dictBind)(v)(function (v1) {
          var v2 = k(v1.value0);
          return Data_Functor.map(dictBind.Apply0().Functor0())(function (v3) {
            return new Data_Tuple.Tuple(v3.value0, Data_Semigroup.append(dictSemigroup)(v1.value1)(v3.value1));
          })(v2);
        }));
      };
    });
  };
};

var applicativeWriterT = function applicativeWriterT(dictMonoid) {
  return function (dictApplicative) {
    return new Control_Applicative.Applicative(function () {
      return applyWriterT(dictMonoid.Semigroup0())(dictApplicative.Apply0());
    }, function (a) {
      return WriterT(Control_Applicative.pure(dictApplicative)(new Data_Tuple.Tuple(a, Data_Monoid.mempty(dictMonoid))));
    });
  };
};

var monadWriterT = function monadWriterT(dictMonoid) {
  return function (dictMonad) {
    return new Control_Monad.Monad(function () {
      return applicativeWriterT(dictMonoid)(dictMonad.Applicative0());
    }, function () {
      return bindWriterT(dictMonoid.Semigroup0())(dictMonad.Bind1());
    });
  };
};

var monadAskWriterT = function monadAskWriterT(dictMonoid) {
  return function (dictMonadAsk) {
    return new Control_Monad_Reader_Class.MonadAsk(function () {
      return monadWriterT(dictMonoid)(dictMonadAsk.Monad0());
    }, Control_Monad_Trans_Class.lift(monadTransWriterT(dictMonoid))(dictMonadAsk.Monad0())(Control_Monad_Reader_Class.ask(dictMonadAsk)));
  };
};

var monadReaderWriterT = function monadReaderWriterT(dictMonoid) {
  return function (dictMonadReader) {
    return new Control_Monad_Reader_Class.MonadReader(function () {
      return monadAskWriterT(dictMonoid)(dictMonadReader.MonadAsk0());
    }, function (f) {
      return mapWriterT(Control_Monad_Reader_Class.local(dictMonadReader)(f));
    });
  };
};

var monadContWriterT = function monadContWriterT(dictMonoid) {
  return function (dictMonadCont) {
    return new Control_Monad_Cont_Class.MonadCont(function () {
      return monadWriterT(dictMonoid)(dictMonadCont.Monad0());
    }, function (f) {
      return WriterT(Control_Monad_Cont_Class.callCC(dictMonadCont)(function (c) {
        var v = f(function (a) {
          return WriterT(c(new Data_Tuple.Tuple(a, Data_Monoid.mempty(dictMonoid))));
        });
        return v;
      }));
    });
  };
};

var monadEffectWriter = function monadEffectWriter(dictMonoid) {
  return function (dictMonadEffect) {
    return new Effect_Class.MonadEffect(function () {
      return monadWriterT(dictMonoid)(dictMonadEffect.Monad0());
    }, function () {
      var $121 = Control_Monad_Trans_Class.lift(monadTransWriterT(dictMonoid))(dictMonadEffect.Monad0());
      var $122 = Effect_Class.liftEffect(dictMonadEffect);
      return function ($123) {
        return $121($122($123));
      };
    }());
  };
};

var monadRecWriterT = function monadRecWriterT(dictMonoid) {
  return function (dictMonadRec) {
    return new Control_Monad_Rec_Class.MonadRec(function () {
      return monadWriterT(dictMonoid)(dictMonadRec.Monad0());
    }, function (f) {
      return function (a) {
        var f$prime = function f$prime(v) {
          var v1 = f(v.value0);
          return Control_Bind.bind(dictMonadRec.Monad0().Bind1())(v1)(function (v2) {
            return Control_Applicative.pure(dictMonadRec.Monad0().Applicative0())(function () {
              if (v2.value0 instanceof Control_Monad_Rec_Class.Loop) {
                return new Control_Monad_Rec_Class.Loop(new Data_Tuple.Tuple(v2.value0.value0, Data_Semigroup.append(dictMonoid.Semigroup0())(v.value1)(v2.value1)));
              }

              ;

              if (v2.value0 instanceof Control_Monad_Rec_Class.Done) {
                return new Control_Monad_Rec_Class.Done(new Data_Tuple.Tuple(v2.value0.value0, Data_Semigroup.append(dictMonoid.Semigroup0())(v.value1)(v2.value1)));
              }

              ;
              throw new Error("Failed pattern match at Control.Monad.Writer.Trans (line 83, column 16 - line 85, column 47): " + [v2.value0.constructor.name]);
            }());
          });
        };

        return WriterT(Control_Monad_Rec_Class.tailRecM(dictMonadRec)(f$prime)(new Data_Tuple.Tuple(a, Data_Monoid.mempty(dictMonoid))));
      };
    });
  };
};

var monadStateWriterT = function monadStateWriterT(dictMonoid) {
  return function (dictMonadState) {
    return new Control_Monad_State_Class.MonadState(function () {
      return monadWriterT(dictMonoid)(dictMonadState.Monad0());
    }, function (f) {
      return Control_Monad_Trans_Class.lift(monadTransWriterT(dictMonoid))(dictMonadState.Monad0())(Control_Monad_State_Class.state(dictMonadState)(f));
    });
  };
};

var monadTellWriterT = function monadTellWriterT(dictMonoid) {
  return function (dictMonad) {
    return new Control_Monad_Writer_Class.MonadTell(function () {
      return monadWriterT(dictMonoid)(dictMonad);
    }, function () {
      var $124 = Control_Applicative.pure(dictMonad.Applicative0());
      var $125 = Data_Tuple.Tuple.create(Data_Unit.unit);
      return function ($126) {
        return WriterT($124($125($126)));
      };
    }());
  };
};

var monadWriterWriterT = function monadWriterWriterT(dictMonoid) {
  return function (dictMonad) {
    return new Control_Monad_Writer_Class.MonadWriter(function () {
      return monadTellWriterT(dictMonoid)(dictMonad);
    }, function (v) {
      return Control_Bind.bind(dictMonad.Bind1())(v)(function (v1) {
        return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Tuple.Tuple(new Data_Tuple.Tuple(v1.value0, v1.value1), v1.value1));
      });
    }, function (v) {
      return Control_Bind.bind(dictMonad.Bind1())(v)(function (v1) {
        return Control_Applicative.pure(dictMonad.Applicative0())(new Data_Tuple.Tuple(v1.value0.value0, v1.value0.value1(v1.value1)));
      });
    });
  };
};

var monadThrowWriterT = function monadThrowWriterT(dictMonoid) {
  return function (dictMonadThrow) {
    return new Control_Monad_Error_Class.MonadThrow(function () {
      return monadWriterT(dictMonoid)(dictMonadThrow.Monad0());
    }, function (e) {
      return Control_Monad_Trans_Class.lift(monadTransWriterT(dictMonoid))(dictMonadThrow.Monad0())(Control_Monad_Error_Class.throwError(dictMonadThrow)(e));
    });
  };
};

var monadErrorWriterT = function monadErrorWriterT(dictMonoid) {
  return function (dictMonadError) {
    return new Control_Monad_Error_Class.MonadError(function () {
      return monadThrowWriterT(dictMonoid)(dictMonadError.MonadThrow0());
    }, function (v) {
      return function (h) {
        return WriterT(Control_Monad_Error_Class.catchError(dictMonadError)(v)(function (e) {
          var v1 = h(e);
          return v1;
        }));
      };
    });
  };
};

var altWriterT = function altWriterT(dictAlt) {
  return new Control_Alt.Alt(function () {
    return functorWriterT(dictAlt.Functor0());
  }, function (v) {
    return function (v1) {
      return Control_Alt.alt(dictAlt)(v)(v1);
    };
  });
};

var plusWriterT = function plusWriterT(dictPlus) {
  return new Control_Plus.Plus(function () {
    return altWriterT(dictPlus.Alt0());
  }, Control_Plus.empty(dictPlus));
};

var alternativeWriterT = function alternativeWriterT(dictMonoid) {
  return function (dictAlternative) {
    return new Control_Alternative.Alternative(function () {
      return applicativeWriterT(dictMonoid)(dictAlternative.Applicative0());
    }, function () {
      return plusWriterT(dictAlternative.Plus1());
    });
  };
};

var monadZeroWriterT = function monadZeroWriterT(dictMonoid) {
  return function (dictMonadZero) {
    return new Control_MonadZero.MonadZero(function () {
      return alternativeWriterT(dictMonoid)(dictMonadZero.Alternative1());
    }, function () {
      return monadWriterT(dictMonoid)(dictMonadZero.Monad0());
    });
  };
};

var monadPlusWriterT = function monadPlusWriterT(dictMonoid) {
  return function (dictMonadPlus) {
    return new Control_MonadPlus.MonadPlus(function () {
      return monadZeroWriterT(dictMonoid)(dictMonadPlus.MonadZero0());
    });
  };
};

module.exports = {
  WriterT: WriterT,
  runWriterT: runWriterT,
  execWriterT: execWriterT,
  mapWriterT: mapWriterT,
  newtypeWriterT: newtypeWriterT,
  functorWriterT: functorWriterT,
  applyWriterT: applyWriterT,
  applicativeWriterT: applicativeWriterT,
  altWriterT: altWriterT,
  plusWriterT: plusWriterT,
  alternativeWriterT: alternativeWriterT,
  bindWriterT: bindWriterT,
  monadWriterT: monadWriterT,
  monadRecWriterT: monadRecWriterT,
  monadZeroWriterT: monadZeroWriterT,
  monadPlusWriterT: monadPlusWriterT,
  monadTransWriterT: monadTransWriterT,
  monadEffectWriter: monadEffectWriter,
  monadContWriterT: monadContWriterT,
  monadThrowWriterT: monadThrowWriterT,
  monadErrorWriterT: monadErrorWriterT,
  monadAskWriterT: monadAskWriterT,
  monadReaderWriterT: monadReaderWriterT,
  monadStateWriterT: monadStateWriterT,
  monadTellWriterT: monadTellWriterT,
  monadWriterWriterT: monadWriterWriterT
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Monad.Cont.Class/index.js":"../output/Control.Monad.Cont.Class/index.js","../Control.Monad.Error.Class/index.js":"../output/Control.Monad.Error.Class/index.js","../Control.Monad.Reader.Class/index.js":"../output/Control.Monad.Reader.Class/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Control.Monad.State.Class/index.js":"../output/Control.Monad.State.Class/index.js","../Control.Monad.Trans.Class/index.js":"../output/Control.Monad.Trans.Class/index.js","../Control.Monad.Writer.Class/index.js":"../output/Control.Monad.Writer.Class/index.js","../Control.MonadPlus/index.js":"../output/Control.MonadPlus/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js"}],"../output/Data.Functor.App/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Unsafe_Coerce = require("../Unsafe.Coerce/index.js");

var App = function App(x) {
  return x;
};

var traversableWithIndexApp = function traversableWithIndexApp(dictTraversableWithIndex) {
  return dictTraversableWithIndex;
};

var traversableApp = function traversableApp(dictTraversable) {
  return dictTraversable;
};

var showApp = function showApp(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(App " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semigroupApp = function semigroupApp(dictApply) {
  return function (dictSemigroup) {
    return new Data_Semigroup.Semigroup(function (v) {
      return function (v1) {
        return Control_Apply.lift2(dictApply)(Data_Semigroup.append(dictSemigroup))(v)(v1);
      };
    });
  };
};

var plusApp = function plusApp(dictPlus) {
  return dictPlus;
};

var newtypeApp = new Data_Newtype.Newtype(function (n) {
  return n;
}, App);

var monoidApp = function monoidApp(dictApplicative) {
  return function (dictMonoid) {
    return new Data_Monoid.Monoid(function () {
      return semigroupApp(dictApplicative.Apply0())(dictMonoid.Semigroup0());
    }, Control_Applicative.pure(dictApplicative)(Data_Monoid.mempty(dictMonoid)));
  };
};

var monadZeroApp = function monadZeroApp(dictMonadZero) {
  return dictMonadZero;
};

var monadPlusApp = function monadPlusApp(dictMonadPlus) {
  return dictMonadPlus;
};

var monadApp = function monadApp(dictMonad) {
  return dictMonad;
};

var lazyApp = function lazyApp(dictLazy) {
  return dictLazy;
};

var hoistLowerApp = Unsafe_Coerce.unsafeCoerce;
var hoistLiftApp = Unsafe_Coerce.unsafeCoerce;

var hoistApp = function hoistApp(f) {
  return function (v) {
    return f(v);
  };
};

var functorWithIndexApp = function functorWithIndexApp(dictFunctorWithIndex) {
  return dictFunctorWithIndex;
};

var functorApp = function functorApp(dictFunctor) {
  return dictFunctor;
};

var foldableWithIndexApp = function foldableWithIndexApp(dictFoldableWithIndex) {
  return dictFoldableWithIndex;
};

var foldableApp = function foldableApp(dictFoldable) {
  return dictFoldable;
};

var extendApp = function extendApp(dictExtend) {
  return dictExtend;
};

var eqApp = function eqApp(dictEq1) {
  return function (dictEq) {
    return new Data_Eq.Eq(function (x) {
      return function (y) {
        return Data_Eq.eq1(dictEq1)(dictEq)(x)(y);
      };
    });
  };
};

var ordApp = function ordApp(dictOrd1) {
  return function (dictOrd) {
    return new Data_Ord.Ord(function () {
      return eqApp(dictOrd1.Eq10())(dictOrd.Eq0());
    }, function (x) {
      return function (y) {
        return Data_Ord.compare1(dictOrd1)(dictOrd)(x)(y);
      };
    });
  };
};

var eq1App = function eq1App(dictEq1) {
  return new Data_Eq.Eq1(function (dictEq) {
    return Data_Eq.eq(eqApp(dictEq1)(dictEq));
  });
};

var ord1App = function ord1App(dictOrd1) {
  return new Data_Ord.Ord1(function () {
    return eq1App(dictOrd1.Eq10());
  }, function (dictOrd) {
    return Data_Ord.compare(ordApp(dictOrd1)(dictOrd));
  });
};

var comonadApp = function comonadApp(dictComonad) {
  return dictComonad;
};

var bindApp = function bindApp(dictBind) {
  return dictBind;
};

var applyApp = function applyApp(dictApply) {
  return dictApply;
};

var applicativeApp = function applicativeApp(dictApplicative) {
  return dictApplicative;
};

var alternativeApp = function alternativeApp(dictAlternative) {
  return dictAlternative;
};

var altApp = function altApp(dictAlt) {
  return dictAlt;
};

module.exports = {
  App: App,
  hoistApp: hoistApp,
  hoistLiftApp: hoistLiftApp,
  hoistLowerApp: hoistLowerApp,
  newtypeApp: newtypeApp,
  eqApp: eqApp,
  eq1App: eq1App,
  ordApp: ordApp,
  ord1App: ord1App,
  showApp: showApp,
  semigroupApp: semigroupApp,
  monoidApp: monoidApp,
  functorApp: functorApp,
  functorWithIndexApp: functorWithIndexApp,
  applyApp: applyApp,
  applicativeApp: applicativeApp,
  bindApp: bindApp,
  monadApp: monadApp,
  altApp: altApp,
  plusApp: plusApp,
  alternativeApp: alternativeApp,
  monadZeroApp: monadZeroApp,
  monadPlusApp: monadPlusApp,
  lazyApp: lazyApp,
  foldableApp: foldableApp,
  traversableApp: traversableApp,
  foldableWithIndexApp: foldableWithIndexApp,
  traversableWithIndexApp: traversableWithIndexApp,
  extendApp: extendApp,
  comonadApp: comonadApp
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Unsafe.Coerce/index.js":"../output/Unsafe.Coerce/index.js"}],"../output/Data.Functor.Compose/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_App = require("../Data.Functor.App/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Compose = function Compose(x) {
  return x;
};

var showCompose = function showCompose(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Compose " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var newtypeCompose = new Data_Newtype.Newtype(function (n) {
  return n;
}, Compose);

var functorCompose = function functorCompose(dictFunctor) {
  return function (dictFunctor1) {
    return new Data_Functor.Functor(function (f) {
      return function (v) {
        return Compose(Data_Functor.map(dictFunctor)(Data_Functor.map(dictFunctor1)(f))(v));
      };
    });
  };
};

var functorWithIndexCompose = function functorWithIndexCompose(dictFunctorWithIndex) {
  return function (dictFunctorWithIndex1) {
    return new Data_FunctorWithIndex.FunctorWithIndex(function () {
      return functorCompose(dictFunctorWithIndex.Functor0())(dictFunctorWithIndex1.Functor0());
    }, function (f) {
      return function (v) {
        return Compose(Data_FunctorWithIndex.mapWithIndex(dictFunctorWithIndex)(function () {
          var $100 = Data_FunctorWithIndex.mapWithIndex(dictFunctorWithIndex1);
          var $101 = Data_Tuple.curry(f);
          return function ($102) {
            return $100($101($102));
          };
        }())(v));
      };
    });
  };
};

var foldableCompose = function foldableCompose(dictFoldable) {
  return function (dictFoldable1) {
    return new Data_Foldable.Foldable(function (dictMonoid) {
      return function (f) {
        return function (v) {
          return Data_Foldable.foldMap(dictFoldable)(dictMonoid)(Data_Foldable.foldMap(dictFoldable1)(dictMonoid)(f))(v);
        };
      };
    }, function (f) {
      return function (i) {
        return function (v) {
          return Data_Foldable.foldl(dictFoldable)(Data_Foldable.foldl(dictFoldable1)(f))(i)(v);
        };
      };
    }, function (f) {
      return function (i) {
        return function (v) {
          return Data_Foldable.foldr(dictFoldable)(Data_Function.flip(Data_Foldable.foldr(dictFoldable1)(f)))(i)(v);
        };
      };
    });
  };
};

var foldableWithIndexCompose = function foldableWithIndexCompose(dictFoldableWithIndex) {
  return function (dictFoldableWithIndex1) {
    return new Data_FoldableWithIndex.FoldableWithIndex(function () {
      return foldableCompose(dictFoldableWithIndex.Foldable0())(dictFoldableWithIndex1.Foldable0());
    }, function (dictMonoid) {
      return function (f) {
        return function (v) {
          return Data_FoldableWithIndex.foldMapWithIndex(dictFoldableWithIndex)(dictMonoid)(function () {
            var $103 = Data_FoldableWithIndex.foldMapWithIndex(dictFoldableWithIndex1)(dictMonoid);
            var $104 = Data_Tuple.curry(f);
            return function ($105) {
              return $103($104($105));
            };
          }())(v);
        };
      };
    }, function (f) {
      return function (i) {
        return function (v) {
          return Data_FoldableWithIndex.foldlWithIndex(dictFoldableWithIndex)(function () {
            var $106 = Data_FoldableWithIndex.foldlWithIndex(dictFoldableWithIndex1);
            var $107 = Data_Tuple.curry(f);
            return function ($108) {
              return $106($107($108));
            };
          }())(i)(v);
        };
      };
    }, function (f) {
      return function (i) {
        return function (v) {
          return Data_FoldableWithIndex.foldrWithIndex(dictFoldableWithIndex)(function (a) {
            return Data_Function.flip(Data_FoldableWithIndex.foldrWithIndex(dictFoldableWithIndex1)(Data_Tuple.curry(f)(a)));
          })(i)(v);
        };
      };
    });
  };
};

var traversableCompose = function traversableCompose(dictTraversable) {
  return function (dictTraversable1) {
    return new Data_Traversable.Traversable(function () {
      return foldableCompose(dictTraversable.Foldable1())(dictTraversable1.Foldable1());
    }, function () {
      return functorCompose(dictTraversable.Functor0())(dictTraversable1.Functor0());
    }, function (dictApplicative) {
      return Data_Traversable.traverse(traversableCompose(dictTraversable)(dictTraversable1))(dictApplicative)(Control_Category.identity(Control_Category.categoryFn));
    }, function (dictApplicative) {
      return function (f) {
        return function (v) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Compose)(Data_Traversable.traverse(dictTraversable)(dictApplicative)(Data_Traversable.traverse(dictTraversable1)(dictApplicative)(f))(v));
        };
      };
    });
  };
};

var traversableWithIndexCompose = function traversableWithIndexCompose(dictTraversableWithIndex) {
  return function (dictTraversableWithIndex1) {
    return new Data_TraversableWithIndex.TraversableWithIndex(function () {
      return foldableWithIndexCompose(dictTraversableWithIndex.FoldableWithIndex1())(dictTraversableWithIndex1.FoldableWithIndex1());
    }, function () {
      return functorWithIndexCompose(dictTraversableWithIndex.FunctorWithIndex0())(dictTraversableWithIndex1.FunctorWithIndex0());
    }, function () {
      return traversableCompose(dictTraversableWithIndex.Traversable2())(dictTraversableWithIndex1.Traversable2());
    }, function (dictApplicative) {
      return function (f) {
        return function (v) {
          return Data_Functor.map(dictApplicative.Apply0().Functor0())(Compose)(Data_TraversableWithIndex.traverseWithIndex(dictTraversableWithIndex)(dictApplicative)(function () {
            var $109 = Data_TraversableWithIndex.traverseWithIndex(dictTraversableWithIndex1)(dictApplicative);
            var $110 = Data_Tuple.curry(f);
            return function ($111) {
              return $109($110($111));
            };
          }())(v));
        };
      };
    });
  };
};

var eqCompose = function eqCompose(dictEq1) {
  return function (dictEq11) {
    return function (dictEq) {
      return new Data_Eq.Eq(function (v) {
        return function (v1) {
          return Data_Eq.eq1(dictEq1)(Data_Functor_App.eqApp(dictEq11)(dictEq))(Data_Functor_App.hoistLiftApp(v))(Data_Functor_App.hoistLiftApp(v1));
        };
      });
    };
  };
};

var ordCompose = function ordCompose(dictOrd1) {
  return function (dictOrd11) {
    return function (dictOrd) {
      return new Data_Ord.Ord(function () {
        return eqCompose(dictOrd1.Eq10())(dictOrd11.Eq10())(dictOrd.Eq0());
      }, function (v) {
        return function (v1) {
          return Data_Ord.compare1(dictOrd1)(Data_Functor_App.ordApp(dictOrd11)(dictOrd))(Data_Functor_App.hoistLiftApp(v))(Data_Functor_App.hoistLiftApp(v1));
        };
      });
    };
  };
};

var eq1Compose = function eq1Compose(dictEq1) {
  return function (dictEq11) {
    return new Data_Eq.Eq1(function (dictEq) {
      return Data_Eq.eq(eqCompose(dictEq1)(dictEq11)(dictEq));
    });
  };
};

var ord1Compose = function ord1Compose(dictOrd1) {
  return function (dictOrd11) {
    return new Data_Ord.Ord1(function () {
      return eq1Compose(dictOrd1.Eq10())(dictOrd11.Eq10());
    }, function (dictOrd) {
      return Data_Ord.compare(ordCompose(dictOrd1)(dictOrd11)(dictOrd));
    });
  };
};

var bihoistCompose = function bihoistCompose(dictFunctor) {
  return function (natF) {
    return function (natG) {
      return function (v) {
        return natF(Data_Functor.map(dictFunctor)(natG)(v));
      };
    };
  };
};

var applyCompose = function applyCompose(dictApply) {
  return function (dictApply1) {
    return new Control_Apply.Apply(function () {
      return functorCompose(dictApply.Functor0())(dictApply1.Functor0());
    }, function (v) {
      return function (v1) {
        return Compose(Control_Apply.apply(dictApply)(Data_Functor.map(dictApply.Functor0())(Control_Apply.apply(dictApply1))(v))(v1));
      };
    });
  };
};

var applicativeCompose = function applicativeCompose(dictApplicative) {
  return function (dictApplicative1) {
    return new Control_Applicative.Applicative(function () {
      return applyCompose(dictApplicative.Apply0())(dictApplicative1.Apply0());
    }, function () {
      var $112 = Control_Applicative.pure(dictApplicative);
      var $113 = Control_Applicative.pure(dictApplicative1);
      return function ($114) {
        return Compose($112($113($114)));
      };
    }());
  };
};

var altCompose = function altCompose(dictAlt) {
  return function (dictFunctor) {
    return new Control_Alt.Alt(function () {
      return functorCompose(dictAlt.Functor0())(dictFunctor);
    }, function (v) {
      return function (v1) {
        return Compose(Control_Alt.alt(dictAlt)(v)(v1));
      };
    });
  };
};

var plusCompose = function plusCompose(dictPlus) {
  return function (dictFunctor) {
    return new Control_Plus.Plus(function () {
      return altCompose(dictPlus.Alt0())(dictFunctor);
    }, Control_Plus.empty(dictPlus));
  };
};

var alternativeCompose = function alternativeCompose(dictAlternative) {
  return function (dictApplicative) {
    return new Control_Alternative.Alternative(function () {
      return applicativeCompose(dictAlternative.Applicative0())(dictApplicative);
    }, function () {
      return plusCompose(dictAlternative.Plus1())(dictApplicative.Apply0().Functor0());
    });
  };
};

module.exports = {
  Compose: Compose,
  bihoistCompose: bihoistCompose,
  newtypeCompose: newtypeCompose,
  eqCompose: eqCompose,
  eq1Compose: eq1Compose,
  ordCompose: ordCompose,
  ord1Compose: ord1Compose,
  showCompose: showCompose,
  functorCompose: functorCompose,
  functorWithIndexCompose: functorWithIndexCompose,
  applyCompose: applyCompose,
  applicativeCompose: applicativeCompose,
  foldableCompose: foldableCompose,
  foldableWithIndexCompose: foldableWithIndexCompose,
  traversableCompose: traversableCompose,
  traversableWithIndexCompose: traversableWithIndexCompose,
  altCompose: altCompose,
  plusCompose: plusCompose,
  alternativeCompose: alternativeCompose
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.App/index.js":"../output/Data.Functor.App/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Control.Parallel.Class/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad_Cont_Trans = require("../Control.Monad.Cont.Trans/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Control_Monad_Maybe_Trans = require("../Control.Monad.Maybe.Trans/index.js");

var Control_Monad_Reader_Trans = require("../Control.Monad.Reader.Trans/index.js");

var Control_Monad_Writer_Trans = require("../Control.Monad.Writer.Trans/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Compose = require("../Data.Functor.Compose/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var Effect_Ref = require("../Effect.Ref/index.js");

var ParCont = function ParCont(x) {
  return x;
};

var Parallel = function Parallel(Applicative1, Monad0, parallel, sequential) {
  this.Applicative1 = Applicative1;
  this.Monad0 = Monad0;
  this.parallel = parallel;
  this.sequential = sequential;
};

var sequential = function sequential(dict) {
  return dict.sequential;
};

var parallel = function parallel(dict) {
  return dict.parallel;
};

var newtypeParCont = new Data_Newtype.Newtype(function (n) {
  return n;
}, ParCont);

var monadParWriterT = function monadParWriterT(dictMonoid) {
  return function (dictParallel) {
    return new Parallel(function () {
      return Control_Monad_Writer_Trans.applicativeWriterT(dictMonoid)(dictParallel.Applicative1());
    }, function () {
      return Control_Monad_Writer_Trans.monadWriterT(dictMonoid)(dictParallel.Monad0());
    }, Control_Monad_Writer_Trans.mapWriterT(parallel(dictParallel)), Control_Monad_Writer_Trans.mapWriterT(sequential(dictParallel)));
  };
};

var monadParReaderT = function monadParReaderT(dictParallel) {
  return new Parallel(function () {
    return Control_Monad_Reader_Trans.applicativeReaderT(dictParallel.Applicative1());
  }, function () {
    return Control_Monad_Reader_Trans.monadReaderT(dictParallel.Monad0());
  }, Control_Monad_Reader_Trans.mapReaderT(parallel(dictParallel)), Control_Monad_Reader_Trans.mapReaderT(sequential(dictParallel)));
};

var monadParMaybeT = function monadParMaybeT(dictParallel) {
  return new Parallel(function () {
    return Data_Functor_Compose.applicativeCompose(dictParallel.Applicative1())(Data_Maybe.applicativeMaybe);
  }, function () {
    return Control_Monad_Maybe_Trans.monadMaybeT(dictParallel.Monad0());
  }, function (v) {
    return parallel(dictParallel)(v);
  }, function (v) {
    return sequential(dictParallel)(v);
  });
};

var monadParExceptT = function monadParExceptT(dictParallel) {
  return new Parallel(function () {
    return Data_Functor_Compose.applicativeCompose(dictParallel.Applicative1())(Data_Either.applicativeEither);
  }, function () {
    return Control_Monad_Except_Trans.monadExceptT(dictParallel.Monad0());
  }, function (v) {
    return parallel(dictParallel)(v);
  }, function (v) {
    return sequential(dictParallel)(v);
  });
};

var monadParParCont = function monadParParCont(dictMonadEffect) {
  return new Parallel(function () {
    return applicativeParCont(dictMonadEffect);
  }, function () {
    return Control_Monad_Cont_Trans.monadContT(dictMonadEffect.Monad0());
  }, ParCont, function (v) {
    return v;
  });
};

var functorParCont = function functorParCont(dictMonadEffect) {
  return new Data_Functor.Functor(function (f) {
    var $40 = parallel(monadParParCont(dictMonadEffect));
    var $41 = Data_Functor.map(Control_Monad_Cont_Trans.functorContT(dictMonadEffect.Monad0().Bind1().Apply0().Functor0()))(f);
    var $42 = sequential(monadParParCont(dictMonadEffect));
    return function ($43) {
      return $40($41($42($43)));
    };
  });
};

var applyParCont = function applyParCont(dictMonadEffect) {
  return new Control_Apply.Apply(function () {
    return functorParCont(dictMonadEffect);
  }, function (v) {
    return function (v1) {
      return ParCont(function (k) {
        return Control_Bind.bind(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref["new"](Data_Maybe.Nothing.value)))(function (ra) {
          return Control_Bind.bind(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref["new"](Data_Maybe.Nothing.value)))(function (rb) {
            return Control_Bind.discard(Control_Bind.discardUnit)(dictMonadEffect.Monad0().Bind1())(Control_Monad_Cont_Trans.runContT(v)(function (a) {
              return Control_Bind.bind(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.read(rb)))(function (mb) {
                if (mb instanceof Data_Maybe.Nothing) {
                  return Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.write(new Data_Maybe.Just(a))(ra));
                }

                ;

                if (mb instanceof Data_Maybe.Just) {
                  return k(a(mb.value0));
                }

                ;
                throw new Error("Failed pattern match at Control.Parallel.Class (line 71, column 7 - line 73, column 26): " + [mb.constructor.name]);
              });
            }))(function () {
              return Control_Monad_Cont_Trans.runContT(v1)(function (b) {
                return Control_Bind.bind(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.read(ra)))(function (ma) {
                  if (ma instanceof Data_Maybe.Nothing) {
                    return Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.write(new Data_Maybe.Just(b))(rb));
                  }

                  ;

                  if (ma instanceof Data_Maybe.Just) {
                    return k(ma.value0(b));
                  }

                  ;
                  throw new Error("Failed pattern match at Control.Parallel.Class (line 77, column 7 - line 79, column 26): " + [ma.constructor.name]);
                });
              });
            });
          });
        });
      });
    };
  });
};

var applicativeParCont = function applicativeParCont(dictMonadEffect) {
  return new Control_Applicative.Applicative(function () {
    return applyParCont(dictMonadEffect);
  }, function () {
    var $44 = parallel(monadParParCont(dictMonadEffect));
    var $45 = Control_Applicative.pure(Control_Monad_Cont_Trans.applicativeContT(dictMonadEffect.Monad0().Applicative0()));
    return function ($46) {
      return $44($45($46));
    };
  }());
};

var altParCont = function altParCont(dictMonadEffect) {
  return new Control_Alt.Alt(function () {
    return functorParCont(dictMonadEffect);
  }, function (v) {
    return function (v1) {
      return ParCont(function (k) {
        return Control_Bind.bind(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref["new"](false)))(function (done) {
          return Control_Bind.discard(Control_Bind.discardUnit)(dictMonadEffect.Monad0().Bind1())(Control_Monad_Cont_Trans.runContT(v)(function (a) {
            return Control_Bind.bind(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.read(done)))(function (b) {
              if (b) {
                return Control_Applicative.pure(dictMonadEffect.Monad0().Applicative0())(Data_Unit.unit);
              }

              ;
              return Control_Bind.discard(Control_Bind.discardUnit)(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.write(true)(done)))(function () {
                return k(a);
              });
            });
          }))(function () {
            return Control_Monad_Cont_Trans.runContT(v1)(function (a) {
              return Control_Bind.bind(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.read(done)))(function (b) {
                if (b) {
                  return Control_Applicative.pure(dictMonadEffect.Monad0().Applicative0())(Data_Unit.unit);
                }

                ;
                return Control_Bind.discard(Control_Bind.discardUnit)(dictMonadEffect.Monad0().Bind1())(Effect_Class.liftEffect(dictMonadEffect)(Effect_Ref.write(true)(done)))(function () {
                  return k(a);
                });
              });
            });
          });
        });
      });
    };
  });
};

var plusParCont = function plusParCont(dictMonadEffect) {
  return new Control_Plus.Plus(function () {
    return altParCont(dictMonadEffect);
  }, ParCont(function (v) {
    return Control_Applicative.pure(dictMonadEffect.Monad0().Applicative0())(Data_Unit.unit);
  }));
};

var alternativeParCont = function alternativeParCont(dictMonadEffect) {
  return new Control_Alternative.Alternative(function () {
    return applicativeParCont(dictMonadEffect);
  }, function () {
    return plusParCont(dictMonadEffect);
  });
};

module.exports = {
  parallel: parallel,
  sequential: sequential,
  Parallel: Parallel,
  ParCont: ParCont,
  monadParExceptT: monadParExceptT,
  monadParReaderT: monadParReaderT,
  monadParWriterT: monadParWriterT,
  monadParMaybeT: monadParMaybeT,
  newtypeParCont: newtypeParCont,
  functorParCont: functorParCont,
  applyParCont: applyParCont,
  applicativeParCont: applicativeParCont,
  altParCont: altParCont,
  plusParCont: plusParCont,
  alternativeParCont: alternativeParCont,
  monadParParCont: monadParParCont
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad.Cont.Trans/index.js":"../output/Control.Monad.Cont.Trans/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Control.Monad.Maybe.Trans/index.js":"../output/Control.Monad.Maybe.Trans/index.js","../Control.Monad.Reader.Trans/index.js":"../output/Control.Monad.Reader.Trans/index.js","../Control.Monad.Writer.Trans/index.js":"../output/Control.Monad.Writer.Trans/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Compose/index.js":"../output/Data.Functor.Compose/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js","../Effect.Ref/index.js":"../output/Effect.Ref/index.js"}],"../output/Control.Parallel/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Parallel_Class = require("../Control.Parallel.Class/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var parTraverse_ = function parTraverse_(dictParallel) {
  return function (dictFoldable) {
    return function (f) {
      var $17 = Control_Parallel_Class.sequential(dictParallel);
      var $18 = Data_Foldable.traverse_(dictParallel.Applicative1())(dictFoldable)(function () {
        var $20 = Control_Parallel_Class.parallel(dictParallel);
        return function ($21) {
          return $20(f($21));
        };
      }());
      return function ($19) {
        return $17($18($19));
      };
    };
  };
};

var parTraverse = function parTraverse(dictParallel) {
  return function (dictTraversable) {
    return function (f) {
      var $22 = Control_Parallel_Class.sequential(dictParallel);
      var $23 = Data_Traversable.traverse(dictTraversable)(dictParallel.Applicative1())(function () {
        var $25 = Control_Parallel_Class.parallel(dictParallel);
        return function ($26) {
          return $25(f($26));
        };
      }());
      return function ($24) {
        return $22($23($24));
      };
    };
  };
};

var parSequence_ = function parSequence_(dictParallel) {
  return function (dictFoldable) {
    return parTraverse_(dictParallel)(dictFoldable)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var parSequence = function parSequence(dictParallel) {
  return function (dictTraversable) {
    return parTraverse(dictParallel)(dictTraversable)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var parOneOfMap = function parOneOfMap(dictParallel) {
  return function (dictAlternative) {
    return function (dictFoldable) {
      return function (dictFunctor) {
        return function (f) {
          var $27 = Control_Parallel_Class.sequential(dictParallel);
          var $28 = Data_Foldable.oneOfMap(dictFoldable)(dictAlternative.Plus1())(function () {
            var $30 = Control_Parallel_Class.parallel(dictParallel);
            return function ($31) {
              return $30(f($31));
            };
          }());
          return function ($29) {
            return $27($28($29));
          };
        };
      };
    };
  };
};

var parOneOf = function parOneOf(dictParallel) {
  return function (dictAlternative) {
    return function (dictFoldable) {
      return function (dictFunctor) {
        var $32 = Control_Parallel_Class.sequential(dictParallel);
        var $33 = Data_Foldable.oneOfMap(dictFoldable)(dictAlternative.Plus1())(Control_Parallel_Class.parallel(dictParallel));
        return function ($34) {
          return $32($33($34));
        };
      };
    };
  };
};

var parApply = function parApply(dictParallel) {
  return function (mf) {
    return function (ma) {
      return Control_Parallel_Class.sequential(dictParallel)(Control_Apply.apply(dictParallel.Applicative1().Apply0())(Control_Parallel_Class.parallel(dictParallel)(mf))(Control_Parallel_Class.parallel(dictParallel)(ma)));
    };
  };
};

module.exports = {
  parApply: parApply,
  parTraverse: parTraverse,
  parTraverse_: parTraverse_,
  parSequence: parSequence,
  parSequence_: parSequence_,
  parOneOf: parOneOf,
  parOneOfMap: parOneOfMap
};
},{"../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Parallel.Class/index.js":"../output/Control.Parallel.Class/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js"}],"../output/Effect.Aff/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Lazy = require("../Control.Lazy/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_Monad_Error_Class = require("../Control.Monad.Error.Class/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Control_Parallel = require("../Control.Parallel/index.js");

var Control_Parallel_Class = require("../Control.Parallel.Class/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Effect = require("../Effect/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var Effect_Exception = require("../Effect.Exception/index.js");

var Effect_Unsafe = require("../Effect.Unsafe/index.js");

var Partial_Unsafe = require("../Partial.Unsafe/index.js");

var Unsafe_Coerce = require("../Unsafe.Coerce/index.js");

var Fiber = function Fiber(x) {
  return x;
};

var FFIUtil = function FFIUtil(x) {
  return x;
};

var Canceler = function Canceler(x) {
  return x;
};

var suspendAff = $foreign["_fork"](false);
var newtypeCanceler = new Data_Newtype.Newtype(function (n) {
  return n;
}, Canceler);
var functorParAff = new Data_Functor.Functor($foreign["_parAffMap"]);
var functorAff = new Data_Functor.Functor($foreign["_map"]);
var forkAff = $foreign["_fork"](true);

var ffiUtil = function () {
  var unsafeFromRight = function unsafeFromRight(v) {
    if (v instanceof Data_Either.Right) {
      return v.value0;
    }

    ;

    if (v instanceof Data_Either.Left) {
      return Partial_Unsafe.unsafeCrashWith("unsafeFromRight: Left");
    }

    ;
    throw new Error("Failed pattern match at Effect.Aff (line 400, column 21 - line 402, column 54): " + [v.constructor.name]);
  };

  var unsafeFromLeft = function unsafeFromLeft(v) {
    if (v instanceof Data_Either.Left) {
      return v.value0;
    }

    ;

    if (v instanceof Data_Either.Right) {
      return Partial_Unsafe.unsafeCrashWith("unsafeFromLeft: Right");
    }

    ;
    throw new Error("Failed pattern match at Effect.Aff (line 395, column 20 - line 397, column 54): " + [v.constructor.name]);
  };

  var isLeft = function isLeft(v) {
    if (v instanceof Data_Either.Left) {
      return true;
    }

    ;

    if (v instanceof Data_Either.Right) {
      return false;
    }

    ;
    throw new Error("Failed pattern match at Effect.Aff (line 390, column 12 - line 392, column 20): " + [v.constructor.name]);
  };

  return {
    isLeft: isLeft,
    fromLeft: unsafeFromLeft,
    fromRight: unsafeFromRight,
    left: Data_Either.Left.create,
    right: Data_Either.Right.create
  };
}();

var makeFiber = function makeFiber(aff) {
  return $foreign["_makeFiber"](ffiUtil, aff);
};

var launchAff = function launchAff(aff) {
  return function __do() {
    var fiber = makeFiber(aff)();
    fiber.run();
    return fiber;
  };
};

var launchAff_ = function () {
  var $43 = Data_Functor["void"](Effect.functorEffect);
  return function ($44) {
    return $43(launchAff($44));
  };
}();

var launchSuspendedAff = makeFiber;

var delay = function delay(v) {
  return $foreign["_delay"](Data_Either.Right.create, v);
};

var bracket = function bracket(acquire) {
  return function (completed) {
    return $foreign.generalBracket(acquire)({
      killed: Data_Function["const"](completed),
      failed: Data_Function["const"](completed),
      completed: Data_Function["const"](completed)
    });
  };
};

var applyParAff = new Control_Apply.Apply(function () {
  return functorParAff;
}, $foreign["_parAffApply"]);

var semigroupParAff = function semigroupParAff(dictSemigroup) {
  return new Data_Semigroup.Semigroup(Control_Apply.lift2(applyParAff)(Data_Semigroup.append(dictSemigroup)));
};

var monadAff = new Control_Monad.Monad(function () {
  return applicativeAff;
}, function () {
  return bindAff;
});
var bindAff = new Control_Bind.Bind(function () {
  return applyAff;
}, $foreign["_bind"]);
var applyAff = new Control_Apply.Apply(function () {
  return functorAff;
}, Control_Monad.ap(monadAff));
var applicativeAff = new Control_Applicative.Applicative(function () {
  return applyAff;
}, $foreign["_pure"]);

var cancelWith = function cancelWith(aff) {
  return function (v) {
    return $foreign.generalBracket(Control_Applicative.pure(applicativeAff)(Data_Unit.unit))({
      killed: function killed(e) {
        return function (v1) {
          return v(e);
        };
      },
      failed: Data_Function["const"](Control_Applicative.pure(applicativeAff)),
      completed: Data_Function["const"](Control_Applicative.pure(applicativeAff))
    })(Data_Function["const"](aff));
  };
};

var $$finally = function $$finally(fin) {
  return function (a) {
    return bracket(Control_Applicative.pure(applicativeAff)(Data_Unit.unit))(Data_Function["const"](fin))(Data_Function["const"](a));
  };
};

var invincible = function invincible(a) {
  return bracket(a)(Data_Function["const"](Control_Applicative.pure(applicativeAff)(Data_Unit.unit)))(Control_Applicative.pure(applicativeAff));
};

var lazyAff = new Control_Lazy.Lazy(function (f) {
  return Control_Bind.bind(bindAff)(Control_Applicative.pure(applicativeAff)(Data_Unit.unit))(f);
});

var semigroupAff = function semigroupAff(dictSemigroup) {
  return new Data_Semigroup.Semigroup(Control_Apply.lift2(applyAff)(Data_Semigroup.append(dictSemigroup)));
};

var monadEffectAff = new Effect_Class.MonadEffect(function () {
  return monadAff;
}, $foreign["_liftEffect"]);

var effectCanceler = function () {
  var $45 = Effect_Class.liftEffect(monadEffectAff);
  return function ($46) {
    return Canceler(Data_Function["const"]($45($46)));
  };
}();

var joinFiber = function joinFiber(v) {
  return $foreign.makeAff(function (k) {
    return Data_Functor.map(Effect.functorEffect)(effectCanceler)(v.join(k));
  });
};

var functorFiber = new Data_Functor.Functor(function (f) {
  return function (t) {
    return Effect_Unsafe.unsafePerformEffect(makeFiber(Data_Functor.map(functorAff)(f)(joinFiber(t))));
  };
});
var applyFiber = new Control_Apply.Apply(function () {
  return functorFiber;
}, function (t1) {
  return function (t2) {
    return Effect_Unsafe.unsafePerformEffect(makeFiber(Control_Apply.apply(applyAff)(joinFiber(t1))(joinFiber(t2))));
  };
});
var applicativeFiber = new Control_Applicative.Applicative(function () {
  return applyFiber;
}, function (a) {
  return Effect_Unsafe.unsafePerformEffect(makeFiber(Control_Applicative.pure(applicativeAff)(a)));
});

var killFiber = function killFiber(e) {
  return function (v) {
    return Control_Bind.bind(bindAff)(Effect_Class.liftEffect(monadEffectAff)(v.isSuspended))(function (v1) {
      if (v1) {
        return Effect_Class.liftEffect(monadEffectAff)(Data_Functor["void"](Effect.functorEffect)(v.kill(e, Data_Function["const"](Control_Applicative.pure(Effect.applicativeEffect)(Data_Unit.unit)))));
      }

      ;
      return $foreign.makeAff(function (k) {
        return Data_Functor.map(Effect.functorEffect)(effectCanceler)(v.kill(e, k));
      });
    });
  };
};

var fiberCanceler = function () {
  var $47 = Data_Function.flip(killFiber);
  return function ($48) {
    return Canceler($47($48));
  };
}();

var monadThrowAff = new Control_Monad_Error_Class.MonadThrow(function () {
  return monadAff;
}, $foreign["_throwError"]);
var monadErrorAff = new Control_Monad_Error_Class.MonadError(function () {
  return monadThrowAff;
}, $foreign["_catchError"]);
var attempt = Control_Monad_Error_Class["try"](monadErrorAff);

var runAff = function runAff(k) {
  return function (aff) {
    return launchAff(Control_Bind.bindFlipped(bindAff)(function () {
      var $49 = Effect_Class.liftEffect(monadEffectAff);
      return function ($50) {
        return $49(k($50));
      };
    }())(Control_Monad_Error_Class["try"](monadErrorAff)(aff)));
  };
};

var runAff_ = function runAff_(k) {
  return function (aff) {
    return Data_Functor["void"](Effect.functorEffect)(runAff(k)(aff));
  };
};

var runSuspendedAff = function runSuspendedAff(k) {
  return function (aff) {
    return launchSuspendedAff(Control_Bind.bindFlipped(bindAff)(function () {
      var $51 = Effect_Class.liftEffect(monadEffectAff);
      return function ($52) {
        return $51(k($52));
      };
    }())(Control_Monad_Error_Class["try"](monadErrorAff)(aff)));
  };
};

var parallelAff = new Control_Parallel_Class.Parallel(function () {
  return applicativeParAff;
}, function () {
  return monadAff;
}, Unsafe_Coerce.unsafeCoerce, $foreign["_sequential"]);
var applicativeParAff = new Control_Applicative.Applicative(function () {
  return applyParAff;
}, function () {
  var $53 = Control_Parallel_Class.parallel(parallelAff);
  var $54 = Control_Applicative.pure(applicativeAff);
  return function ($55) {
    return $53($54($55));
  };
}());

var monoidParAff = function monoidParAff(dictMonoid) {
  return new Data_Monoid.Monoid(function () {
    return semigroupParAff(dictMonoid.Semigroup0());
  }, Control_Applicative.pure(applicativeParAff)(Data_Monoid.mempty(dictMonoid)));
};

var semigroupCanceler = new Data_Semigroup.Semigroup(function (v) {
  return function (v1) {
    return function (err) {
      return Control_Parallel.parSequence_(parallelAff)(Data_Foldable.foldableArray)([v(err), v1(err)]);
    };
  };
});

var supervise = function supervise(aff) {
  var killError = Effect_Exception.error("[Aff] Child fiber outlived parent");

  var killAll = function killAll(err) {
    return function (sup) {
      return $foreign.makeAff(function (k) {
        return $foreign["_killAll"](err, sup.supervisor, k(Control_Applicative.pure(Data_Either.applicativeEither)(Data_Unit.unit)));
      });
    };
  };

  var acquire = function __do() {
    var sup = $foreign["_makeSupervisedFiber"](ffiUtil, aff)();
    sup.fiber.run();
    return sup;
  };

  return $foreign.generalBracket(Effect_Class.liftEffect(monadEffectAff)(acquire))({
    killed: function killed(err) {
      return function (sup) {
        return Control_Parallel.parSequence_(parallelAff)(Data_Foldable.foldableArray)([killFiber(err)(sup.fiber), killAll(err)(sup)]);
      };
    },
    failed: Data_Function["const"](killAll(killError)),
    completed: Data_Function["const"](killAll(killError))
  })(function ($56) {
    return joinFiber(function (v) {
      return v.fiber;
    }($56));
  });
};

var monadRecAff = new Control_Monad_Rec_Class.MonadRec(function () {
  return monadAff;
}, function (k) {
  var go = function go(a) {
    return Control_Bind.bind(bindAff)(k(a))(function (res) {
      if (res instanceof Control_Monad_Rec_Class.Done) {
        return Control_Applicative.pure(applicativeAff)(res.value0);
      }

      ;

      if (res instanceof Control_Monad_Rec_Class.Loop) {
        return go(res.value0);
      }

      ;
      throw new Error("Failed pattern match at Effect.Aff (line 100, column 7 - line 102, column 22): " + [res.constructor.name]);
    });
  };

  return go;
});

var monoidAff = function monoidAff(dictMonoid) {
  return new Data_Monoid.Monoid(function () {
    return semigroupAff(dictMonoid.Semigroup0());
  }, Control_Applicative.pure(applicativeAff)(Data_Monoid.mempty(dictMonoid)));
};

var nonCanceler = Data_Function["const"](Control_Applicative.pure(applicativeAff)(Data_Unit.unit));
var monoidCanceler = new Data_Monoid.Monoid(function () {
  return semigroupCanceler;
}, nonCanceler);
var never = $foreign.makeAff(function (v) {
  return Control_Applicative.pure(Effect.applicativeEffect)(Data_Monoid.mempty(monoidCanceler));
});

var apathize = function () {
  var $57 = Data_Functor.map(functorAff)(Data_Function["const"](Data_Unit.unit));
  return function ($58) {
    return $57(attempt($58));
  };
}();

var altParAff = new Control_Alt.Alt(function () {
  return functorParAff;
}, $foreign["_parAffAlt"]);
var altAff = new Control_Alt.Alt(function () {
  return functorAff;
}, function (a1) {
  return function (a2) {
    return Control_Monad_Error_Class.catchError(monadErrorAff)(a1)(Data_Function["const"](a2));
  };
});
var plusAff = new Control_Plus.Plus(function () {
  return altAff;
}, Control_Monad_Error_Class.throwError(monadThrowAff)(Effect_Exception.error("Always fails")));
var plusParAff = new Control_Plus.Plus(function () {
  return altParAff;
}, Control_Parallel_Class.parallel(parallelAff)(Control_Plus.empty(plusAff)));
var alternativeParAff = new Control_Alternative.Alternative(function () {
  return applicativeParAff;
}, function () {
  return plusParAff;
});
module.exports = {
  Canceler: Canceler,
  launchAff: launchAff,
  launchAff_: launchAff_,
  launchSuspendedAff: launchSuspendedAff,
  runAff: runAff,
  runAff_: runAff_,
  runSuspendedAff: runSuspendedAff,
  forkAff: forkAff,
  suspendAff: suspendAff,
  supervise: supervise,
  attempt: attempt,
  apathize: apathize,
  delay: delay,
  never: never,
  "finally": $$finally,
  invincible: invincible,
  killFiber: killFiber,
  joinFiber: joinFiber,
  cancelWith: cancelWith,
  bracket: bracket,
  nonCanceler: nonCanceler,
  effectCanceler: effectCanceler,
  fiberCanceler: fiberCanceler,
  functorAff: functorAff,
  applyAff: applyAff,
  applicativeAff: applicativeAff,
  bindAff: bindAff,
  monadAff: monadAff,
  semigroupAff: semigroupAff,
  monoidAff: monoidAff,
  altAff: altAff,
  plusAff: plusAff,
  monadRecAff: monadRecAff,
  monadThrowAff: monadThrowAff,
  monadErrorAff: monadErrorAff,
  monadEffectAff: monadEffectAff,
  lazyAff: lazyAff,
  functorParAff: functorParAff,
  applyParAff: applyParAff,
  applicativeParAff: applicativeParAff,
  semigroupParAff: semigroupParAff,
  monoidParAff: monoidParAff,
  altParAff: altParAff,
  plusParAff: plusParAff,
  alternativeParAff: alternativeParAff,
  parallelAff: parallelAff,
  functorFiber: functorFiber,
  applyFiber: applyFiber,
  applicativeFiber: applicativeFiber,
  newtypeCanceler: newtypeCanceler,
  semigroupCanceler: semigroupCanceler,
  monoidCanceler: monoidCanceler,
  makeAff: $foreign.makeAff,
  generalBracket: $foreign.generalBracket
};
},{"./foreign.js":"../output/Effect.Aff/foreign.js","../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Lazy/index.js":"../output/Control.Lazy/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.Monad.Error.Class/index.js":"../output/Control.Monad.Error.Class/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Control.Parallel/index.js":"../output/Control.Parallel/index.js","../Control.Parallel.Class/index.js":"../output/Control.Parallel.Class/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Effect/index.js":"../output/Effect/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js","../Effect.Exception/index.js":"../output/Effect.Exception/index.js","../Effect.Unsafe/index.js":"../output/Effect.Unsafe/index.js","../Partial.Unsafe/index.js":"../output/Partial.Unsafe/index.js","../Unsafe.Coerce/index.js":"../output/Unsafe.Coerce/index.js"}],"../output/Control.Promise/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Alt = require("../Control.Alt/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Monad_Except = require("../Control.Monad.Except/index.js");

var Control_Monad_Except_Trans = require("../Control.Monad.Except.Trans/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Effect = require("../Effect/index.js");

var Effect_Aff = require("../Effect.Aff/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var Effect_Exception = require("../Effect.Exception/index.js");

var Foreign = require("../Foreign/index.js");

var toAff$prime = function toAff$prime(customCoerce) {
  return function (p) {
    return Effect_Aff.makeAff(function (cb) {
      return Data_Functor.voidRight(Effect.functorEffect)(Data_Monoid.mempty(Effect_Aff.monoidCanceler))($foreign.thenImpl(p)(function ($1) {
        return cb(Data_Either.Left.create(customCoerce($1)))();
      })(function ($2) {
        return cb(Data_Either.Right.create($2))();
      }));
    });
  };
};

var fromAff = function fromAff(aff) {
  return $foreign.promise(function (succ) {
    return function (err) {
      return Effect_Aff.runAff_(Data_Either.either(err)(succ))(aff);
    };
  });
};

var coerce = function coerce(fn) {
  return Data_Either.either(function (v) {
    return Effect_Exception.error("Promise failed, couldn't extract JS Error or String");
  })(Control_Category.identity(Control_Category.categoryFn))(Control_Monad_Except.runExcept(Control_Alt.alt(Control_Monad_Except_Trans.altExceptT(Data_List_Types.semigroupNonEmptyList)(Data_Identity.monadIdentity))(Foreign.unsafeReadTagged("Error")(fn))(Data_Functor.map(Control_Monad_Except_Trans.functorExceptT(Data_Identity.functorIdentity))(Effect_Exception.error)(Foreign.readString(fn)))));
};

var toAff = toAff$prime(coerce);

var toAffE = function toAffE(f) {
  return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(f))(toAff);
};

module.exports = {
  fromAff: fromAff,
  toAff: toAff,
  "toAff'": toAff$prime,
  toAffE: toAffE
};
},{"./foreign.js":"../output/Control.Promise/foreign.js","../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad.Except/index.js":"../output/Control.Monad.Except/index.js","../Control.Monad.Except.Trans/index.js":"../output/Control.Monad.Except.Trans/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Effect/index.js":"../output/Effect/index.js","../Effect.Aff/index.js":"../output/Effect.Aff/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js","../Effect.Exception/index.js":"../output/Effect.Exception/index.js","../Foreign/index.js":"../output/Foreign/index.js"}],"../output/Data.Generic.Rep.Show/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Generic_Rep = require("../Data.Generic.Rep/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var GenericShowArgs = function GenericShowArgs(genericShowArgs) {
  this.genericShowArgs = genericShowArgs;
};

var GenericShow = function GenericShow(genericShow$prime) {
  this["genericShow'"] = genericShow$prime;
};

var genericShowArgsNoArguments = new GenericShowArgs(function (v) {
  return [];
});

var genericShowArgsArgument = function genericShowArgsArgument(dictShow) {
  return new GenericShowArgs(function (v) {
    return [Data_Show.show(dictShow)(v)];
  });
};

var genericShowArgs = function genericShowArgs(dict) {
  return dict.genericShowArgs;
};

var genericShowArgsProduct = function genericShowArgsProduct(dictGenericShowArgs) {
  return function (dictGenericShowArgs1) {
    return new GenericShowArgs(function (v) {
      return Data_Semigroup.append(Data_Semigroup.semigroupArray)(genericShowArgs(dictGenericShowArgs)(v.value0))(genericShowArgs(dictGenericShowArgs1)(v.value1));
    });
  };
};

var genericShowConstructor = function genericShowConstructor(dictGenericShowArgs) {
  return function (dictIsSymbol) {
    return new GenericShow(function (v) {
      var ctor = Data_Symbol.reflectSymbol(dictIsSymbol)(Data_Symbol.SProxy.value);
      var v1 = genericShowArgs(dictGenericShowArgs)(v);

      if (v1.length === 0) {
        return ctor;
      }

      ;
      return "(" + (Data_Foldable.intercalate(Data_Foldable.foldableArray)(Data_Monoid.monoidString)(" ")(Data_Semigroup.append(Data_Semigroup.semigroupArray)([ctor])(v1)) + ")");
    });
  };
};

var genericShow$prime = function genericShow$prime(dict) {
  return dict["genericShow'"];
};

var genericShowNoConstructors = new GenericShow(function (a) {
  return genericShow$prime(genericShowNoConstructors)(a);
});

var genericShowSum = function genericShowSum(dictGenericShow) {
  return function (dictGenericShow1) {
    return new GenericShow(function (v) {
      if (v instanceof Data_Generic_Rep.Inl) {
        return genericShow$prime(dictGenericShow)(v.value0);
      }

      ;

      if (v instanceof Data_Generic_Rep.Inr) {
        return genericShow$prime(dictGenericShow1)(v.value0);
      }

      ;
      throw new Error("Failed pattern match at Data.Generic.Rep.Show (line 26, column 1 - line 28, column 40): " + [v.constructor.name]);
    });
  };
};

var genericShow = function genericShow(dictGeneric) {
  return function (dictGenericShow) {
    return function (x) {
      return genericShow$prime(dictGenericShow)(Data_Generic_Rep.from(dictGeneric)(x));
    };
  };
};

module.exports = {
  GenericShow: GenericShow,
  "genericShow'": genericShow$prime,
  genericShow: genericShow,
  GenericShowArgs: GenericShowArgs,
  genericShowArgs: genericShowArgs,
  genericShowNoConstructors: genericShowNoConstructors,
  genericShowArgsNoArguments: genericShowArgsNoArguments,
  genericShowSum: genericShowSum,
  genericShowArgsProduct: genericShowArgsProduct,
  genericShowConstructor: genericShowConstructor,
  genericShowArgsArgument: genericShowArgsArgument
};
},{"../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Generic.Rep/index.js":"../output/Data.Generic.Rep/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js"}],"../output/Data.Number.Format/foreign.js":[function(require,module,exports) {
function wrap(method) {
  return function (d) {
    return function (num) {
      return method.apply(num, [d]);
    };
  };
}

exports.toPrecisionNative = wrap(Number.prototype.toPrecision);
exports.toFixedNative = wrap(Number.prototype.toFixed);
exports.toExponentialNative = wrap(Number.prototype.toExponential);

exports.toString = function (num) {
  return num.toString();
};
},{}],"../output/Data.Number.Format/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Ord = require("../Data.Ord/index.js");

var Precision = function () {
  function Precision(value0) {
    this.value0 = value0;
  }

  ;

  Precision.create = function (value0) {
    return new Precision(value0);
  };

  return Precision;
}();

var Fixed = function () {
  function Fixed(value0) {
    this.value0 = value0;
  }

  ;

  Fixed.create = function (value0) {
    return new Fixed(value0);
  };

  return Fixed;
}();

var Exponential = function () {
  function Exponential(value0) {
    this.value0 = value0;
  }

  ;

  Exponential.create = function (value0) {
    return new Exponential(value0);
  };

  return Exponential;
}();

var toStringWith = function toStringWith(v) {
  if (v instanceof Precision) {
    return $foreign.toPrecisionNative(v.value0);
  }

  ;

  if (v instanceof Fixed) {
    return $foreign.toFixedNative(v.value0);
  }

  ;

  if (v instanceof Exponential) {
    return $foreign.toExponentialNative(v.value0);
  }

  ;
  throw new Error("Failed pattern match at Data.Number.Format (line 59, column 1 - line 59, column 40): " + [v.constructor.name]);
};

var precision = function () {
  var $5 = Data_Ord.clamp(Data_Ord.ordInt)(1)(21);
  return function ($6) {
    return Precision.create($5($6));
  };
}();

var fixed = function () {
  var $7 = Data_Ord.clamp(Data_Ord.ordInt)(0)(20);
  return function ($8) {
    return Fixed.create($7($8));
  };
}();

var exponential = function () {
  var $9 = Data_Ord.clamp(Data_Ord.ordInt)(0)(20);
  return function ($10) {
    return Exponential.create($9($10));
  };
}();

module.exports = {
  precision: precision,
  fixed: fixed,
  exponential: exponential,
  toStringWith: toStringWith,
  toString: $foreign.toString
};
},{"./foreign.js":"../output/Data.Number.Format/foreign.js","../Data.Ord/index.js":"../output/Data.Ord/index.js"}],"../output/Browser.Tabs/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Browser_Utils = require("../Browser.Utils/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Promise = require("../Control.Promise/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Generic_Rep = require("../Data.Generic.Rep/index.js");

var Data_Generic_Rep_Show = require("../Data.Generic.Rep.Show/index.js");

var Data_List = require("../Data.List/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Number_Format = require("../Data.Number.Format/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Effect = require("../Effect/index.js");

var Effect_Aff = require("../Effect.Aff/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var Foreign_Generic = require("../Foreign.Generic/index.js");

var Foreign_Generic_Class = require("../Foreign.Generic.Class/index.js");

var WindowId = function WindowId(x) {
  return x;
};

var TabId = function TabId(x) {
  return x;
};

var Tab = function Tab(x) {
  return x;
};

var showWindowId = new Data_Show.Show(function (v) {
  return Data_Number_Format.toString(v);
});
var showTabId = new Data_Show.Show(function (v) {
  return Data_Number_Format.toString(v);
});
var newtypeTab = new Data_Newtype.Newtype(function (n) {
  return n;
}, Tab);
var genWindowId = new Data_Generic_Rep.Generic(function (x) {
  return x;
}, function (x) {
  return x;
});
var genTabId = new Data_Generic_Rep.Generic(function (x) {
  return x;
}, function (x) {
  return x;
});
var genTab = new Data_Generic_Rep.Generic(function (x) {
  return x;
}, function (x) {
  return x;
});
var showTab = new Data_Show.Show(Data_Generic_Rep_Show.genericShow(genTab)(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Data_Show.showRecord()(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "active";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "attention";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "audible";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "autoDiscardable";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "cookieStoreId";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "discarded";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "favIconUrl";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "height";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "hidden";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "highlighted";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "id";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "incognito";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "index";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "isArticle";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "isInReaderMode";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "lastAccessed";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "openerTabId";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "pinned";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "sessionId";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "status";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "title";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "url";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "width";
}))(Data_Show.showRecordFieldsCons(new Data_Symbol.IsSymbol(function () {
  return "windowId";
}))(Data_Show.showRecordFieldsNil)(showWindowId))(Data_Maybe.showMaybe(Data_Show.showNumber)))(Data_Maybe.showMaybe(Data_Show.showString)))(Data_Show.showString))(Data_Maybe.showMaybe(Data_Show.showString)))(Data_Maybe.showMaybe(Data_Show.showString)))(Data_Show.showBoolean))(Data_Maybe.showMaybe(showTabId)))(Data_Show.showNumber))(Data_Show.showBoolean))(Data_Maybe.showMaybe(Data_Show.showBoolean)))(Data_Show.showNumber))(Data_Show.showBoolean))(showTabId))(Data_Show.showBoolean))(Data_Show.showBoolean))(Data_Maybe.showMaybe(Data_Show.showNumber)))(Data_Maybe.showMaybe(Data_Show.showString)))(Data_Maybe.showMaybe(Data_Show.showBoolean)))(Data_Maybe.showMaybe(Data_Show.showString)))(Data_Maybe.showMaybe(Data_Show.showBoolean)))(Data_Maybe.showMaybe(Data_Show.showBoolean)))(Data_Maybe.showMaybe(Data_Show.showBoolean)))(Data_Show.showBoolean))))(new Data_Symbol.IsSymbol(function () {
  return "Tab";
}))));
var eqWindowId = new Data_Eq.Eq(function (x) {
  return function (y) {
    return x === y;
  };
});
var ordWindowId = new Data_Ord.Ord(function () {
  return eqWindowId;
}, function (x) {
  return function (y) {
    return Data_Ord.compare(Data_Ord.ordNumber)(x)(y);
  };
});
var eqTabId = new Data_Eq.Eq(function (x) {
  return function (y) {
    return x === y;
  };
});
var ordTabId = new Data_Ord.Ord(function () {
  return eqTabId;
}, function (x) {
  return function (y) {
    return Data_Ord.compare(Data_Ord.ordNumber)(x)(y);
  };
});
var encodeWindowId = new Foreign_Generic_Class.Encode(function (x) {
  return Foreign_Generic.genericEncode(genWindowId)(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
    return "WindowId";
  }))(Foreign_Generic_Class.genericEncodeArgsArgument(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.numberEncode))))({
    sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
    unwrapSingleConstructors: true,
    unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
    fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
  })(x);
});
var encodeTabId = new Foreign_Generic_Class.Encode(function (x) {
  return Foreign_Generic.genericEncode(genTabId)(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
    return "TabId";
  }))(Foreign_Generic_Class.genericEncodeArgsArgument(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.numberEncode))))({
    sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
    unwrapSingleConstructors: true,
    unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
    fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
  })(x);
});
var encodeTab = new Foreign_Generic_Class.Encode(function (x) {
  return Foreign_Generic.genericEncode(genTab)(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
    return "Tab";
  }))(Foreign_Generic_Class.genericEncodeArgsArgument(Foreign_Generic_Class.encodeWithOptionsRecord()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordCons()(Foreign_Generic_Class.encodeRecordNil)(new Data_Symbol.IsSymbol(function () {
    return "windowId";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(encodeWindowId)))(new Data_Symbol.IsSymbol(function () {
    return "width";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.numberEncode))))(new Data_Symbol.IsSymbol(function () {
    return "url";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.stringEncode))))(new Data_Symbol.IsSymbol(function () {
    return "title";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.stringEncode)))(new Data_Symbol.IsSymbol(function () {
    return "status";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.stringEncode))))(new Data_Symbol.IsSymbol(function () {
    return "sessionId";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.stringEncode))))(new Data_Symbol.IsSymbol(function () {
    return "pinned";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.booleanEncode)))(new Data_Symbol.IsSymbol(function () {
    return "openerTabId";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(encodeTabId))))(new Data_Symbol.IsSymbol(function () {
    return "lastAccessed";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.numberEncode)))(new Data_Symbol.IsSymbol(function () {
    return "isInReaderMode";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.booleanEncode)))(new Data_Symbol.IsSymbol(function () {
    return "isArticle";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.booleanEncode))))(new Data_Symbol.IsSymbol(function () {
    return "index";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.numberEncode)))(new Data_Symbol.IsSymbol(function () {
    return "incognito";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.booleanEncode)))(new Data_Symbol.IsSymbol(function () {
    return "id";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(encodeTabId)))(new Data_Symbol.IsSymbol(function () {
    return "highlighted";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.booleanEncode)))(new Data_Symbol.IsSymbol(function () {
    return "hidden";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.booleanEncode)))(new Data_Symbol.IsSymbol(function () {
    return "height";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.numberEncode))))(new Data_Symbol.IsSymbol(function () {
    return "favIconUrl";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.stringEncode))))(new Data_Symbol.IsSymbol(function () {
    return "discarded";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.booleanEncode))))(new Data_Symbol.IsSymbol(function () {
    return "cookieStoreId";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.stringEncode))))(new Data_Symbol.IsSymbol(function () {
    return "autoDiscardable";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.booleanEncode))))(new Data_Symbol.IsSymbol(function () {
    return "audible";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.booleanEncode))))(new Data_Symbol.IsSymbol(function () {
    return "attention";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.maybeEncode(Foreign_Generic_Class.booleanEncode))))(new Data_Symbol.IsSymbol(function () {
    return "active";
  }))(Foreign_Generic_Class.encodeWithOptionsOther(Foreign_Generic_Class.booleanEncode))))))({
    sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
    unwrapSingleConstructors: true,
    unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
    fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
  })(x);
});
var decodeWindowId = new Foreign_Generic_Class.Decode(function (x) {
  return Foreign_Generic.genericDecode(genWindowId)(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
    return "WindowId";
  }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.numberDecode)))(Foreign_Generic_Class.genericCountArgsArgument))({
    sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
    unwrapSingleConstructors: true,
    unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
    fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
  })(x);
});
var decodeTabId = new Foreign_Generic_Class.Decode(function (x) {
  return Foreign_Generic.genericDecode(genTabId)(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
    return "TabId";
  }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.numberDecode)))(Foreign_Generic_Class.genericCountArgsArgument))({
    sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
    unwrapSingleConstructors: true,
    unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
    fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
  })(x);
});
var query = Control_Bind.bind(Effect_Aff.bindAff)(Control_Promise.toAffE($foreign.queryImpl))(function (tabsArray) {
  var tabsList = Data_List.fromFoldable(Data_Foldable.foldableArray)(tabsArray);
  return Control_Bind.bind(Effect_Aff.bindAff)(Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(Data_Traversable.traverse(Data_List_Types.traversableList)(Effect.applicativeEffect)(Browser_Utils.unwrapForeign(genTab)(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
    return "Tab";
  }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsRecord()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordNil)(new Data_Symbol.IsSymbol(function () {
    return "windowId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(decodeWindowId))())(new Data_Symbol.IsSymbol(function () {
    return "width";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.numberDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "url";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "title";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.stringDecode))())(new Data_Symbol.IsSymbol(function () {
    return "status";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "sessionId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "pinned";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "openerTabId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(decodeTabId)))())(new Data_Symbol.IsSymbol(function () {
    return "lastAccessed";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.numberDecode))())(new Data_Symbol.IsSymbol(function () {
    return "isInReaderMode";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "isArticle";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "index";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.numberDecode))())(new Data_Symbol.IsSymbol(function () {
    return "incognito";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "id";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(decodeTabId))())(new Data_Symbol.IsSymbol(function () {
    return "highlighted";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "hidden";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "height";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.numberDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "favIconUrl";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "discarded";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "cookieStoreId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "autoDiscardable";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "audible";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "attention";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "active";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())))(Foreign_Generic_Class.genericCountArgsArgument)))(tabsList)))(function (parsed) {
    return Control_Applicative.pure(Effect_Aff.applicativeAff)(parsed);
  });
});
var decodeTab = new Foreign_Generic_Class.Decode(function (x) {
  return Foreign_Generic.genericDecode(genTab)(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
    return "Tab";
  }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsRecord()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordCons()(Foreign_Generic_Class.decodeRecordNil)(new Data_Symbol.IsSymbol(function () {
    return "windowId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(decodeWindowId))())(new Data_Symbol.IsSymbol(function () {
    return "width";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.numberDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "url";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "title";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.stringDecode))())(new Data_Symbol.IsSymbol(function () {
    return "status";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "sessionId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "pinned";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "openerTabId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(decodeTabId)))())(new Data_Symbol.IsSymbol(function () {
    return "lastAccessed";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.numberDecode))())(new Data_Symbol.IsSymbol(function () {
    return "isInReaderMode";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "isArticle";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "index";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.numberDecode))())(new Data_Symbol.IsSymbol(function () {
    return "incognito";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "id";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(decodeTabId))())(new Data_Symbol.IsSymbol(function () {
    return "highlighted";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "hidden";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())(new Data_Symbol.IsSymbol(function () {
    return "height";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.numberDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "favIconUrl";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "discarded";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "cookieStoreId";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.stringDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "autoDiscardable";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "audible";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "attention";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.maybeDecode(Foreign_Generic_Class.booleanDecode)))())(new Data_Symbol.IsSymbol(function () {
    return "active";
  }))(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.booleanDecode))())))(Foreign_Generic_Class.genericCountArgsArgument))({
    sumEncoding: Foreign_Generic_Class.defaultOptions.sumEncoding,
    unwrapSingleConstructors: true,
    unwrapSingleArguments: Foreign_Generic_Class.defaultOptions.unwrapSingleArguments,
    fieldTransform: Foreign_Generic_Class.defaultOptions.fieldTransform
  })(x);
});
module.exports = {
  TabId: TabId,
  Tab: Tab,
  query: query,
  eqWindowId: eqWindowId,
  ordWindowId: ordWindowId,
  showWindowId: showWindowId,
  genWindowId: genWindowId,
  encodeWindowId: encodeWindowId,
  decodeWindowId: decodeWindowId,
  eqTabId: eqTabId,
  ordTabId: ordTabId,
  showTabId: showTabId,
  genTabId: genTabId,
  encodeTabId: encodeTabId,
  decodeTabId: decodeTabId,
  newtypeTab: newtypeTab,
  genTab: genTab,
  showTab: showTab,
  encodeTab: encodeTab,
  decodeTab: decodeTab
};
},{"./foreign.js":"../output/Browser.Tabs/foreign.js","../Browser.Utils/index.js":"../output/Browser.Utils/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Promise/index.js":"../output/Control.Promise/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Generic.Rep/index.js":"../output/Data.Generic.Rep/index.js","../Data.Generic.Rep.Show/index.js":"../output/Data.Generic.Rep.Show/index.js","../Data.List/index.js":"../output/Data.List/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Number.Format/index.js":"../output/Data.Number.Format/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Effect/index.js":"../output/Effect/index.js","../Effect.Aff/index.js":"../output/Effect.Aff/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js","../Foreign.Generic/index.js":"../output/Foreign.Generic/index.js","../Foreign.Generic.Class/index.js":"../output/Foreign.Generic.Class/index.js"}],"../output/Browser.Windows/foreign.js":[function(require,module,exports) {
"use strict";

exports.getCurrentImpl = function () {
  return browser.windows.getCurrent();
};
},{}],"../output/Browser.Windows/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Promise = require("../Control.Promise/index.js");

var getCurrent = Control_Promise.toAffE($foreign.getCurrentImpl);
module.exports = {
  getCurrent: getCurrent
};
},{"./foreign.js":"../output/Browser.Windows/foreign.js","../Control.Promise/index.js":"../output/Control.Promise/index.js"}],"../output/JQuery/foreign.js":[function(require,module,exports) {
/* global exports */
"use strict";

exports.ready = function (func) {
  return function () {
    jQuery(document).ready(func);
  };
};

exports.select = function (selector) {
  return function () {
    return jQuery(selector);
  };
};

exports.find = function (selector) {
  return function (ob) {
    return function () {
      return ob.find(selector);
    };
  };
};

exports.parent = function (ob) {
  return function () {
    return ob.parent();
  };
};

exports.closest = function (selector) {
  return function (ob) {
    return function () {
      return ob.closest(selector);
    };
  };
};

exports.create = function (html) {
  return function () {
    return jQuery(html);
  };
};

exports.setAttr = function (attr) {
  return function (val) {
    return function (ob) {
      return function () {
        ob.attr(attr, val);
      };
    };
  };
};

exports.getAttrImpl = function (attr) {
  return function (ob) {
    return function () {
      return ob.attr(attr);
    };
  };
};

exports.attr = function (attrs) {
  return function (ob) {
    return function () {
      ob.attr(attrs);
    };
  };
};

exports.css = function (props) {
  return function (ob) {
    return function () {
      ob.css(props);
    };
  };
};

exports.hasClass = function (cls) {
  return function (ob) {
    return function () {
      return ob.hasClass(cls);
    };
  };
};

exports.toggleClass = function (cls) {
  return function (ob) {
    return function () {
      ob.toggleClass(cls);
    };
  };
};

exports.setClass = function (cls) {
  return function (flag) {
    return function (ob) {
      return function () {
        ob.toggleClass(cls, flag);
      };
    };
  };
};

exports.setProp = function (p) {
  return function (val) {
    return function (ob) {
      return function () {
        ob.prop(p, val);
      };
    };
  };
};

exports.getProp = function (p) {
  return function (ob) {
    return function () {
      return ob.prop(p);
    };
  };
};

exports.append = function (ob1) {
  return function (ob) {
    return function () {
      ob.append(ob1);
    };
  };
};

exports.unsafeAppendHtml = function (s) {
  return function (ob) {
    return function () {
      ob.append(s);
    };
  };
};

exports.appendText = function (s) {
  return function (ob) {
    return function () {
      ob.append(document.createTextNode(s));
    };
  };
};

exports.body = function () {
  return jQuery(document.body);
};

exports.remove = function (ob) {
  return function () {
    ob.remove();
  };
};

exports.clear = function (ob) {
  return function () {
    ob.empty();
  };
};

exports.before = function (ob) {
  return function (ob1) {
    return function () {
      ob1.before(ob);
    };
  };
};

exports.getText = function (ob) {
  return function () {
    return ob.text();
  };
};

exports.setText = function (text) {
  return function (ob) {
    return function () {
      ob.text(text);
    };
  };
};

exports.getHtml = function (ob) {
  return function () {
    return ob.html();
  };
};

exports.setHtml = function (html) {
  return function (ob) {
    return function () {
      ob.html(html);
    };
  };
};

exports.getValue = function (ob) {
  return function () {
    return ob.val();
  };
};

exports.setValue = function (val) {
  return function (ob) {
    return function () {
      ob.val(val);
    };
  };
};

exports.toggle = function (ob) {
  return function () {
    ob.toggle();
  };
};

exports.setVisible = function (flag) {
  return function (ob) {
    return function () {
      ob.toggle(flag);
    };
  };
};

exports.toArray = function (ob) {
  return function () {
    var els = ob.toArray();
    var copy = [];

    for (var i = 0; i < els.length; i++) {
      copy.push(jQuery(els[i]));
    }

    return copy;
  };
};

exports.on = function (evt) {
  return function (act) {
    return function (ob) {
      return function () {
        ob.on(evt, function (e) {
          act(e)(jQuery(this))();
        });
      };
    };
  };
};

exports["on'"] = function (evt) {
  return function (sel) {
    return function (act) {
      return function (ob) {
        return function () {
          ob.on(evt, sel, function (e) {
            act(e)(jQuery(this))();
          });
        };
      };
    };
  };
};

exports.off = function (evt) {
  return function (ob) {
    return function () {
      return ob.off(evt);
    };
  };
};

exports["off'"] = function (ob) {
  return function () {
    return ob.off();
  };
};

exports.preventDefault = function (e) {
  return function () {
    e.preventDefault();
  };
};

exports.stopPropagation = function (e) {
  return function () {
    e.stopPropagation();
  };
};

exports.stopImmediatePropagation = function (e) {
  return function () {
    e.stopImmediatePropagation();
  };
};

exports.getTarget = function (e) {
  return function () {
    return jQuery(e.target);
  };
};

exports.getCurrentTarget = function (e) {
  return function () {
    return jQuery(e.currentTarget);
  };
};

exports.getPageX = function (e) {
  return function () {
    return e.pageX;
  };
};

exports.getPageY = function (e) {
  return function () {
    return e.pageY;
  };
};

exports.getWhich = function (e) {
  return function () {
    return e.which;
  };
};

exports.getMetaKey = function (e) {
  return function () {
    return e.metaKey;
  };
};

exports.clone = function (ob) {
  return function () {
    return ob.clone();
  };
};

exports.cloneWithDataAndEvents = function (ob) {
  return function () {
    return ob.clone(true);
  };
};
},{}],"../output/JQuery/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Effect = require("../Effect/index.js");

var Foreign = require("../Foreign/index.js");

var removeClass = function removeClass(cls) {
  return $foreign.setClass(cls)(false);
};

var hide = $foreign.setVisible(false);

var getAttr = function getAttr(str) {
  return function (jq) {
    var foreignToString = function foreignToString(f) {
      var $0 = Foreign.isUndefined(f);

      if ($0) {
        return Data_Maybe.Nothing.value;
      }

      ;
      return new Data_Maybe.Just(Foreign.unsafeFromForeign(f));
    };

    return Data_Functor.map(Effect.functorEffect)(foreignToString)($foreign.getAttrImpl(str)(jq));
  };
};

var display = $foreign.setVisible(true);

var addClass = function addClass(cls) {
  return $foreign.setClass(cls)(true);
};

module.exports = {
  getAttr: getAttr,
  addClass: addClass,
  removeClass: removeClass,
  hide: hide,
  display: display,
  ready: $foreign.ready,
  select: $foreign.select,
  find: $foreign.find,
  parent: $foreign.parent,
  closest: $foreign.closest,
  create: $foreign.create,
  setAttr: $foreign.setAttr,
  attr: $foreign.attr,
  css: $foreign.css,
  hasClass: $foreign.hasClass,
  toggleClass: $foreign.toggleClass,
  setClass: $foreign.setClass,
  setProp: $foreign.setProp,
  getProp: $foreign.getProp,
  append: $foreign.append,
  remove: $foreign.remove,
  clear: $foreign.clear,
  before: $foreign.before,
  appendText: $foreign.appendText,
  body: $foreign.body,
  getText: $foreign.getText,
  setText: $foreign.setText,
  getHtml: $foreign.getHtml,
  setHtml: $foreign.setHtml,
  getValue: $foreign.getValue,
  setValue: $foreign.setValue,
  toggle: $foreign.toggle,
  setVisible: $foreign.setVisible,
  on: $foreign.on,
  "on'": $foreign["on'"],
  off: $foreign.off,
  "off'": $foreign["off'"],
  toArray: $foreign.toArray,
  preventDefault: $foreign.preventDefault,
  stopPropagation: $foreign.stopPropagation,
  stopImmediatePropagation: $foreign.stopImmediatePropagation,
  getTarget: $foreign.getTarget,
  getCurrentTarget: $foreign.getCurrentTarget,
  getPageX: $foreign.getPageX,
  getPageY: $foreign.getPageY,
  getWhich: $foreign.getWhich,
  getMetaKey: $foreign.getMetaKey,
  clone: $foreign.clone,
  cloneWithDataAndEvents: $foreign.cloneWithDataAndEvents
};
},{"./foreign.js":"../output/JQuery/foreign.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Effect/index.js":"../output/Effect/index.js","../Foreign/index.js":"../output/Foreign/index.js"}],"../output/Data.Array.NonEmpty.Internal/foreign.js":[function(require,module,exports) {
"use strict";

exports.fold1Impl = function (f) {
  return function (xs) {
    var acc = xs[0];
    var len = xs.length;

    for (var i = 1; i < len; i++) {
      acc = f(acc)(xs[i]);
    }

    return acc;
  };
};

exports.traverse1Impl = function () {
  function Cont(fn) {
    this.fn = fn;
  }

  var emptyList = {};

  var ConsCell = function ConsCell(head, tail) {
    this.head = head;
    this.tail = tail;
  };

  function finalCell(head) {
    return new ConsCell(head, emptyList);
  }

  function consList(x) {
    return function (xs) {
      return new ConsCell(x, xs);
    };
  }

  function listToArray(list) {
    var arr = [];
    var xs = list;

    while (xs !== emptyList) {
      arr.push(xs.head);
      xs = xs.tail;
    }

    return arr;
  }

  return function (apply) {
    return function (map) {
      return function (f) {
        var buildFrom = function buildFrom(x, ys) {
          return apply(map(consList)(f(x)))(ys);
        };

        var go = function go(acc, currentLen, xs) {
          if (currentLen === 0) {
            return acc;
          } else {
            var last = xs[currentLen - 1];
            return new Cont(function () {
              var built = go(buildFrom(last, acc), currentLen - 1, xs);
              return built;
            });
          }
        };

        return function (array) {
          var acc = map(finalCell)(f(array[array.length - 1]));
          var result = go(acc, array.length - 1, array);

          while (result instanceof Cont) {
            result = result.fn();
          }

          return map(listToArray)(result);
        };
      };
    };
  };
}();
},{}],"../output/Data.Array.NonEmpty.Internal/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semigroup_Foldable = require("../Data.Semigroup.Foldable/index.js");

var Data_Semigroup_Traversable = require("../Data.Semigroup.Traversable/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Unfoldable1 = require("../Data.Unfoldable1/index.js");

var NonEmptyArray = function NonEmptyArray(x) {
  return x;
};

var unfoldable1NonEmptyArray = Data_Unfoldable1.unfoldable1Array;
var traversableWithIndexNonEmptyArray = Data_TraversableWithIndex.traversableWithIndexArray;
var traversableNonEmptyArray = Data_Traversable.traversableArray;

var showNonEmptyArray = function showNonEmptyArray(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(NonEmptyArray " + (Data_Show.show(Data_Show.showArray(dictShow))(v) + ")");
  });
};

var semigroupNonEmptyArray = Data_Semigroup.semigroupArray;

var ordNonEmptyArray = function ordNonEmptyArray(dictOrd) {
  return Data_Ord.ordArray(dictOrd);
};

var ord1NonEmptyArray = Data_Ord.ord1Array;
var monadNonEmptyArray = Control_Monad.monadArray;
var functorWithIndexNonEmptyArray = Data_FunctorWithIndex.functorWithIndexArray;
var functorNonEmptyArray = Data_Functor.functorArray;
var foldableWithIndexNonEmptyArray = Data_FoldableWithIndex.foldableWithIndexArray;
var foldableNonEmptyArray = Data_Foldable.foldableArray;
var foldable1NonEmptyArray = new Data_Semigroup_Foldable.Foldable1(function () {
  return foldableNonEmptyArray;
}, function (dictSemigroup) {
  return $foreign.fold1Impl(Data_Semigroup.append(dictSemigroup));
}, function (dictSemigroup) {
  return Data_Semigroup_Foldable.foldMap1Default(foldable1NonEmptyArray)(functorNonEmptyArray)(dictSemigroup);
});
var traversable1NonEmptyArray = new Data_Semigroup_Traversable.Traversable1(function () {
  return foldable1NonEmptyArray;
}, function () {
  return traversableNonEmptyArray;
}, function (dictApply) {
  return Data_Semigroup_Traversable.sequence1Default(traversable1NonEmptyArray)(dictApply);
}, function (dictApply) {
  return $foreign.traverse1Impl(Control_Apply.apply(dictApply))(Data_Functor.map(dictApply.Functor0()));
});

var eqNonEmptyArray = function eqNonEmptyArray(dictEq) {
  return Data_Eq.eqArray(dictEq);
};

var eq1NonEmptyArray = Data_Eq.eq1Array;
var bindNonEmptyArray = Control_Bind.bindArray;
var applyNonEmptyArray = Control_Apply.applyArray;
var applicativeNonEmptyArray = Control_Applicative.applicativeArray;
var altNonEmptyArray = Control_Alt.altArray;
module.exports = {
  showNonEmptyArray: showNonEmptyArray,
  eqNonEmptyArray: eqNonEmptyArray,
  eq1NonEmptyArray: eq1NonEmptyArray,
  ordNonEmptyArray: ordNonEmptyArray,
  ord1NonEmptyArray: ord1NonEmptyArray,
  semigroupNonEmptyArray: semigroupNonEmptyArray,
  functorNonEmptyArray: functorNonEmptyArray,
  functorWithIndexNonEmptyArray: functorWithIndexNonEmptyArray,
  foldableNonEmptyArray: foldableNonEmptyArray,
  foldableWithIndexNonEmptyArray: foldableWithIndexNonEmptyArray,
  foldable1NonEmptyArray: foldable1NonEmptyArray,
  unfoldable1NonEmptyArray: unfoldable1NonEmptyArray,
  traversableNonEmptyArray: traversableNonEmptyArray,
  traversableWithIndexNonEmptyArray: traversableWithIndexNonEmptyArray,
  traversable1NonEmptyArray: traversable1NonEmptyArray,
  applyNonEmptyArray: applyNonEmptyArray,
  applicativeNonEmptyArray: applicativeNonEmptyArray,
  bindNonEmptyArray: bindNonEmptyArray,
  monadNonEmptyArray: monadNonEmptyArray,
  altNonEmptyArray: altNonEmptyArray
};
},{"./foreign.js":"../output/Data.Array.NonEmpty.Internal/foreign.js","../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semigroup.Foldable/index.js":"../output/Data.Semigroup.Foldable/index.js","../Data.Semigroup.Traversable/index.js":"../output/Data.Semigroup.Traversable/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Unfoldable1/index.js":"../output/Data.Unfoldable1/index.js"}],"../output/Data.Array.NonEmpty/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Bind = require("../Control.Bind/index.js");

var Data_Array = require("../Data.Array/index.js");

var Data_Array_NonEmpty_Internal = require("../Data.Array.NonEmpty.Internal/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_NonEmpty = require("../Data.NonEmpty/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable1 = require("../Data.Unfoldable1/index.js");

var Unsafe_Coerce = require("../Unsafe.Coerce/index.js");

var unsafeFromArrayF = Unsafe_Coerce.unsafeCoerce;
var unsafeFromArray = Unsafe_Coerce.unsafeCoerce;
var toArray = Unsafe_Coerce.unsafeCoerce;

var unionBy$prime = function unionBy$prime(eq) {
  return function (xs) {
    var $39 = Data_Array.unionBy(eq)(toArray(xs));
    return function ($40) {
      return unsafeFromArray($39($40));
    };
  };
};

var union$prime = function union$prime(dictEq) {
  return unionBy$prime(Data_Eq.eq(dictEq));
};

var unionBy = function unionBy(eq) {
  return function (xs) {
    var $41 = unionBy$prime(eq)(xs);
    return function ($42) {
      return $41(toArray($42));
    };
  };
};

var union = function union(dictEq) {
  return unionBy(Data_Eq.eq(dictEq));
};

var unzip = function () {
  var $43 = Data_Bifunctor.bimap(Data_Tuple.bifunctorTuple)(unsafeFromArray)(unsafeFromArray);
  return function ($44) {
    return $43(Data_Array.unzip(toArray($44)));
  };
}();

var updateAt = function updateAt(i) {
  return function (x) {
    var $45 = Data_Array.updateAt(i)(x);
    return function ($46) {
      return unsafeFromArrayF($45(toArray($46)));
    };
  };
};

var zip = function zip(xs) {
  return function (ys) {
    return unsafeFromArray(Data_Array.zip(toArray(xs))(toArray(ys)));
  };
};

var zipWith = function zipWith(f) {
  return function (xs) {
    return function (ys) {
      return unsafeFromArray(Data_Array.zipWith(f)(toArray(xs))(toArray(ys)));
    };
  };
};

var zipWithA = function zipWithA(dictApplicative) {
  return function (f) {
    return function (xs) {
      return function (ys) {
        return unsafeFromArrayF(Data_Array.zipWithA(dictApplicative)(f)(toArray(xs))(toArray(ys)));
      };
    };
  };
};

var some = function some(dictAlternative) {
  return function (dictLazy) {
    var $47 = Data_Array.some(dictAlternative)(dictLazy);
    return function ($48) {
      return unsafeFromArrayF($47($48));
    };
  };
};

var snoc$prime = function snoc$prime(xs) {
  return function (x) {
    return unsafeFromArray(Data_Array.snoc(xs)(x));
  };
};

var snoc = function snoc(xs) {
  return function (x) {
    return unsafeFromArray(Data_Array.snoc(toArray(xs))(x));
  };
};

var singleton = function singleton($49) {
  return unsafeFromArray(Data_Array.singleton($49));
};

var replicate = function replicate(i) {
  return function (x) {
    return unsafeFromArray(Data_Array.replicate(Data_Ord.max(Data_Ord.ordInt)(1)(i))(x));
  };
};

var range = function range(x) {
  return function (y) {
    return unsafeFromArray(Data_Array.range(x)(y));
  };
};

var modifyAt = function modifyAt(i) {
  return function (f) {
    var $50 = Data_Array.modifyAt(i)(f);
    return function ($51) {
      return unsafeFromArrayF($50(toArray($51)));
    };
  };
};

var intersectBy$prime = function intersectBy$prime(eq) {
  return function (xs) {
    return Data_Array.intersectBy(eq)(toArray(xs));
  };
};

var intersectBy = function intersectBy(eq) {
  return function (xs) {
    var $52 = intersectBy$prime(eq)(xs);
    return function ($53) {
      return $52(toArray($53));
    };
  };
};

var intersect$prime = function intersect$prime(dictEq) {
  return intersectBy$prime(Data_Eq.eq(dictEq));
};

var intersect = function intersect(dictEq) {
  return intersectBy(Data_Eq.eq(dictEq));
};

var insertAt = function insertAt(i) {
  return function (x) {
    var $54 = Data_Array.insertAt(i)(x);
    return function ($55) {
      return unsafeFromArrayF($54(toArray($55)));
    };
  };
};

var fromFoldable1 = function fromFoldable1(dictFoldable1) {
  var $56 = Data_Array.fromFoldable(dictFoldable1.Foldable0());
  return function ($57) {
    return unsafeFromArray($56($57));
  };
};

var fromArray = function fromArray(xs) {
  if (Data_Array.length(xs) > 0) {
    return new Data_Maybe.Just(unsafeFromArray(xs));
  }

  ;

  if (Data_Boolean.otherwise) {
    return Data_Maybe.Nothing.value;
  }

  ;
  throw new Error("Failed pattern match at Data.Array.NonEmpty (line 134, column 1 - line 134, column 58): " + [xs.constructor.name]);
};

var fromFoldable = function fromFoldable(dictFoldable) {
  var $58 = Data_Array.fromFoldable(dictFoldable);
  return function ($59) {
    return fromArray($58($59));
  };
};

var difference$prime = function difference$prime(dictEq) {
  return function (xs) {
    return Data_Array.difference(dictEq)(toArray(xs));
  };
};

var cons$prime = function cons$prime(x) {
  return function (xs) {
    return unsafeFromArray(Data_Array.cons(x)(xs));
  };
};

var fromNonEmpty = function fromNonEmpty(v) {
  return cons$prime(v.value0)(v.value1);
};

var concatMap = Data_Function.flip(Control_Bind.bind(Data_Array_NonEmpty_Internal.bindNonEmptyArray));

var concat = function () {
  var $60 = Data_Functor.map(Data_Array_NonEmpty_Internal.functorNonEmptyArray)(toArray);
  return function ($61) {
    return unsafeFromArray(Data_Array.concat(toArray($60($61))));
  };
}();

var appendArray = function appendArray(xs) {
  return function (ys) {
    return unsafeFromArray(Data_Semigroup.append(Data_Semigroup.semigroupArray)(toArray(xs))(ys));
  };
};

var alterAt = function alterAt(i) {
  return function (f) {
    var $62 = Data_Array.alterAt(i)(f);
    return function ($63) {
      return $62(toArray($63));
    };
  };
};

var adaptMaybe = function adaptMaybe(f) {
  var $64 = Data_Maybe.fromJust();
  return function ($65) {
    return $64(f(toArray($65)));
  };
};

var head = adaptMaybe(Data_Array.head);
var init = adaptMaybe(Data_Array.init);
var last = adaptMaybe(Data_Array.last);
var tail = adaptMaybe(Data_Array.tail);
var uncons = adaptMaybe(Data_Array.uncons);

var toNonEmpty = function toNonEmpty($66) {
  return function (v) {
    return new Data_NonEmpty.NonEmpty(v.head, v.tail);
  }(uncons($66));
};

var unsnoc = adaptMaybe(Data_Array.unsnoc);

var adaptAny = function adaptAny(f) {
  return function ($67) {
    return f(toArray($67));
  };
};

var catMaybes = adaptAny(Data_Array.catMaybes);

var $$delete = function $$delete(dictEq) {
  return function (x) {
    return adaptAny(Data_Array["delete"](dictEq)(x));
  };
};

var deleteAt = function deleteAt(i) {
  return adaptAny(Data_Array.deleteAt(i));
};

var deleteBy = function deleteBy(f) {
  return function (x) {
    return adaptAny(Data_Array.deleteBy(f)(x));
  };
};

var difference = function difference(dictEq) {
  return function (xs) {
    return adaptAny(difference$prime(dictEq)(xs));
  };
};

var drop = function drop(i) {
  return adaptAny(Data_Array.drop(i));
};

var dropEnd = function dropEnd(i) {
  return adaptAny(Data_Array.dropEnd(i));
};

var dropWhile = function dropWhile(f) {
  return adaptAny(Data_Array.dropWhile(f));
};

var elemIndex = function elemIndex(dictEq) {
  return function (x) {
    return adaptAny(Data_Array.elemIndex(dictEq)(x));
  };
};

var elemLastIndex = function elemLastIndex(dictEq) {
  return function (x) {
    return adaptAny(Data_Array.elemLastIndex(dictEq)(x));
  };
};

var filter = function filter(f) {
  return adaptAny(Data_Array.filter(f));
};

var filterA = function filterA(dictApplicative) {
  return function (f) {
    return adaptAny(Data_Array.filterA(dictApplicative)(f));
  };
};

var findIndex = function findIndex(x) {
  return adaptAny(Data_Array.findIndex(x));
};

var findLastIndex = function findLastIndex(x) {
  return adaptAny(Data_Array.findLastIndex(x));
};

var foldM = function foldM(dictMonad) {
  return function (f) {
    return function (acc) {
      return adaptAny(Data_Array.foldM(dictMonad)(f)(acc));
    };
  };
};

var foldRecM = function foldRecM(dictMonadRec) {
  return function (f) {
    return function (acc) {
      return adaptAny(Data_Array.foldRecM(dictMonadRec)(f)(acc));
    };
  };
};

var index = adaptAny(Data_Array.index);
var length = adaptAny(Data_Array.length);

var mapMaybe = function mapMaybe(f) {
  return adaptAny(Data_Array.mapMaybe(f));
};

var partition = function partition(f) {
  return adaptAny(Data_Array.partition(f));
};

var slice = function slice(start) {
  return function (end) {
    return adaptAny(Data_Array.slice(start)(end));
  };
};

var span = function span(f) {
  return adaptAny(Data_Array.span(f));
};

var take = function take(i) {
  return adaptAny(Data_Array.take(i));
};

var takeEnd = function takeEnd(i) {
  return adaptAny(Data_Array.takeEnd(i));
};

var takeWhile = function takeWhile(f) {
  return adaptAny(Data_Array.takeWhile(f));
};

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  return adaptAny(Data_Array.toUnfoldable(dictUnfoldable));
};

var unsafeAdapt = function unsafeAdapt(f) {
  var $68 = adaptAny(f);
  return function ($69) {
    return unsafeFromArray($68($69));
  };
};

var cons = function cons(x) {
  return unsafeAdapt(Data_Array.cons(x));
};

var insert = function insert(dictOrd) {
  return function (x) {
    return unsafeAdapt(Data_Array.insert(dictOrd)(x));
  };
};

var insertBy = function insertBy(f) {
  return function (x) {
    return unsafeAdapt(Data_Array.insertBy(f)(x));
  };
};

var modifyAtIndices = function modifyAtIndices(dictFoldable) {
  return function (is) {
    return function (f) {
      return unsafeAdapt(Data_Array.modifyAtIndices(dictFoldable)(is)(f));
    };
  };
};

var nub = function nub(dictOrd) {
  return unsafeAdapt(Data_Array.nub(dictOrd));
};

var nubBy = function nubBy(f) {
  return unsafeAdapt(Data_Array.nubBy(f));
};

var nubByEq = function nubByEq(f) {
  return unsafeAdapt(Data_Array.nubByEq(f));
};

var nubEq = function nubEq(dictEq) {
  return unsafeAdapt(Data_Array.nubEq(dictEq));
};

var reverse = unsafeAdapt(Data_Array.reverse);

var sort = function sort(dictOrd) {
  return unsafeAdapt(Data_Array.sort(dictOrd));
};

var sortBy = function sortBy(f) {
  return unsafeAdapt(Data_Array.sortBy(f));
};

var sortWith = function sortWith(dictOrd) {
  return function (f) {
    return unsafeAdapt(Data_Array.sortWith(dictOrd)(f));
  };
};

var updateAtIndices = function updateAtIndices(dictFoldable) {
  return function (pairs) {
    return unsafeAdapt(Data_Array.updateAtIndices(dictFoldable)(pairs));
  };
};

var unsafeIndex = function unsafeIndex(dictPartial) {
  return adaptAny(Data_Array.unsafeIndex());
};

var toUnfoldable1 = function toUnfoldable1(dictUnfoldable1) {
  return function (xs) {
    var len = length(xs);

    var f = function f(i) {
      return Data_Tuple.Tuple.create(unsafeIndex()(xs)(i))(function () {
        var $38 = i < (len - 1 | 0);

        if ($38) {
          return new Data_Maybe.Just(i + 1 | 0);
        }

        ;
        return Data_Maybe.Nothing.value;
      }());
    };

    return Data_Unfoldable1.unfoldr1(dictUnfoldable1)(f)(0);
  };
};

module.exports = {
  fromArray: fromArray,
  fromNonEmpty: fromNonEmpty,
  toArray: toArray,
  toNonEmpty: toNonEmpty,
  fromFoldable: fromFoldable,
  fromFoldable1: fromFoldable1,
  toUnfoldable: toUnfoldable,
  toUnfoldable1: toUnfoldable1,
  singleton: singleton,
  range: range,
  replicate: replicate,
  some: some,
  length: length,
  cons: cons,
  "cons'": cons$prime,
  snoc: snoc,
  "snoc'": snoc$prime,
  appendArray: appendArray,
  insert: insert,
  insertBy: insertBy,
  head: head,
  last: last,
  tail: tail,
  init: init,
  uncons: uncons,
  unsnoc: unsnoc,
  index: index,
  elemIndex: elemIndex,
  elemLastIndex: elemLastIndex,
  findIndex: findIndex,
  findLastIndex: findLastIndex,
  insertAt: insertAt,
  deleteAt: deleteAt,
  updateAt: updateAt,
  updateAtIndices: updateAtIndices,
  modifyAt: modifyAt,
  modifyAtIndices: modifyAtIndices,
  alterAt: alterAt,
  reverse: reverse,
  concat: concat,
  concatMap: concatMap,
  filter: filter,
  partition: partition,
  filterA: filterA,
  mapMaybe: mapMaybe,
  catMaybes: catMaybes,
  sort: sort,
  sortBy: sortBy,
  sortWith: sortWith,
  slice: slice,
  take: take,
  takeEnd: takeEnd,
  takeWhile: takeWhile,
  drop: drop,
  dropEnd: dropEnd,
  dropWhile: dropWhile,
  span: span,
  nub: nub,
  nubBy: nubBy,
  nubEq: nubEq,
  nubByEq: nubByEq,
  union: union,
  "union'": union$prime,
  unionBy: unionBy,
  "unionBy'": unionBy$prime,
  "delete": $$delete,
  deleteBy: deleteBy,
  difference: difference,
  "difference'": difference$prime,
  intersect: intersect,
  "intersect'": intersect$prime,
  intersectBy: intersectBy,
  "intersectBy'": intersectBy$prime,
  zipWith: zipWith,
  zipWithA: zipWithA,
  zip: zip,
  unzip: unzip,
  foldM: foldM,
  foldRecM: foldRecM,
  unsafeIndex: unsafeIndex
};
},{"../Control.Bind/index.js":"../output/Control.Bind/index.js","../Data.Array/index.js":"../output/Data.Array/index.js","../Data.Array.NonEmpty.Internal/index.js":"../output/Data.Array.NonEmpty.Internal/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.NonEmpty/index.js":"../output/Data.NonEmpty/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable1/index.js":"../output/Data.Unfoldable1/index.js","../Unsafe.Coerce/index.js":"../output/Unsafe.Coerce/index.js"}],"../output/Data.Profunctor/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Profunctor = function Profunctor(dimap) {
  this.dimap = dimap;
};

var profunctorFn = new Profunctor(function (a2b) {
  return function (c2d) {
    return function (b2c) {
      return function ($9) {
        return c2d(b2c(a2b($9)));
      };
    };
  };
});

var dimap = function dimap(dict) {
  return dict.dimap;
};

var lcmap = function lcmap(dictProfunctor) {
  return function (a2b) {
    return dimap(dictProfunctor)(a2b)(Control_Category.identity(Control_Category.categoryFn));
  };
};

var rmap = function rmap(dictProfunctor) {
  return function (b2c) {
    return dimap(dictProfunctor)(Control_Category.identity(Control_Category.categoryFn))(b2c);
  };
};

var unwrapIso = function unwrapIso(dictProfunctor) {
  return function (dictNewtype) {
    return dimap(dictProfunctor)(Data_Newtype.wrap(dictNewtype))(Data_Newtype.unwrap(dictNewtype));
  };
};

var wrapIso = function wrapIso(dictProfunctor) {
  return function (dictNewtype) {
    return function (v) {
      return dimap(dictProfunctor)(Data_Newtype.unwrap(dictNewtype))(Data_Newtype.wrap(dictNewtype));
    };
  };
};

var arr = function arr(dictCategory) {
  return function (dictProfunctor) {
    return function (f) {
      return rmap(dictProfunctor)(f)(Control_Category.identity(dictCategory));
    };
  };
};

module.exports = {
  dimap: dimap,
  Profunctor: Profunctor,
  lcmap: lcmap,
  rmap: rmap,
  arr: arr,
  unwrapIso: unwrapIso,
  wrapIso: wrapIso,
  profunctorFn: profunctorFn
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js"}],"../output/Data.Profunctor.Choice/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Choice = function Choice(Profunctor0, left, right) {
  this.Profunctor0 = Profunctor0;
  this.left = left;
  this.right = right;
};

var right = function right(dict) {
  return dict.right;
};

var left = function left(dict) {
  return dict.left;
};

var splitChoice = function splitChoice(dictCategory) {
  return function (dictChoice) {
    return function (l) {
      return function (r) {
        return Control_Semigroupoid.composeFlipped(dictCategory.Semigroupoid0())(left(dictChoice)(l))(right(dictChoice)(r));
      };
    };
  };
};

var fanin = function fanin(dictCategory) {
  return function (dictChoice) {
    return function (l) {
      return function (r) {
        var join = Data_Profunctor.dimap(dictChoice.Profunctor0())(Data_Either.either(Control_Category.identity(Control_Category.categoryFn))(Control_Category.identity(Control_Category.categoryFn)))(Control_Category.identity(Control_Category.categoryFn))(Control_Category.identity(dictCategory));
        return Control_Semigroupoid.composeFlipped(dictCategory.Semigroupoid0())(splitChoice(dictCategory)(dictChoice)(l)(r))(join);
      };
    };
  };
};

var choiceFn = new Choice(function () {
  return Data_Profunctor.profunctorFn;
}, function (v) {
  return function (v1) {
    if (v1 instanceof Data_Either.Left) {
      return Data_Either.Left.create(v(v1.value0));
    }

    ;

    if (v1 instanceof Data_Either.Right) {
      return new Data_Either.Right(v1.value0);
    }

    ;
    throw new Error("Failed pattern match at Data.Profunctor.Choice (line 32, column 1 - line 35, column 16): " + [v.constructor.name, v1.constructor.name]);
  };
}, Data_Functor.map(Data_Either.functorEither));
module.exports = {
  left: left,
  right: right,
  Choice: Choice,
  splitChoice: splitChoice,
  fanin: fanin,
  choiceFn: choiceFn
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js"}],"../output/Data.Profunctor.Closed/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Closed = function Closed(Profunctor0, closed) {
  this.Profunctor0 = Profunctor0;
  this.closed = closed;
};

var closedFunction = new Closed(function () {
  return Data_Profunctor.profunctorFn;
}, Control_Semigroupoid.compose(Control_Semigroupoid.semigroupoidFn));

var closed = function closed(dict) {
  return dict.closed;
};

module.exports = {
  closed: closed,
  Closed: Closed,
  closedFunction: closedFunction
};
},{"../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js"}],"../output/Data.Profunctor.Strong/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Strong = function Strong(Profunctor0, first, second) {
  this.Profunctor0 = Profunctor0;
  this.first = first;
  this.second = second;
};

var strongFn = new Strong(function () {
  return Data_Profunctor.profunctorFn;
}, function (a2b) {
  return function (v) {
    return new Data_Tuple.Tuple(a2b(v.value0), v.value1);
  };
}, Data_Functor.map(Data_Tuple.functorTuple));

var second = function second(dict) {
  return dict.second;
};

var first = function first(dict) {
  return dict.first;
};

var splitStrong = function splitStrong(dictCategory) {
  return function (dictStrong) {
    return function (l) {
      return function (r) {
        return Control_Semigroupoid.composeFlipped(dictCategory.Semigroupoid0())(first(dictStrong)(l))(second(dictStrong)(r));
      };
    };
  };
};

var fanout = function fanout(dictCategory) {
  return function (dictStrong) {
    return function (l) {
      return function (r) {
        var split = Data_Profunctor.dimap(dictStrong.Profunctor0())(Control_Category.identity(Control_Category.categoryFn))(function (a) {
          return new Data_Tuple.Tuple(a, a);
        })(Control_Category.identity(dictCategory));
        return Control_Semigroupoid.composeFlipped(dictCategory.Semigroupoid0())(split)(splitStrong(dictCategory)(dictStrong)(l)(r));
      };
    };
  };
};

module.exports = {
  first: first,
  second: second,
  Strong: Strong,
  splitStrong: splitStrong,
  fanout: fanout,
  strongFn: strongFn
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Profunctor.Star/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_MonadPlus = require("../Control.MonadPlus/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Distributive = require("../Data.Distributive/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Invariant = require("../Data.Functor.Invariant/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var Data_Profunctor_Closed = require("../Data.Profunctor.Closed/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Star = function Star(x) {
  return x;
};

var semigroupoidStar = function semigroupoidStar(dictBind) {
  return new Control_Semigroupoid.Semigroupoid(function (v) {
    return function (v1) {
      return function (x) {
        return Control_Bind.bind(dictBind)(v1(x))(v);
      };
    };
  });
};

var profunctorStar = function profunctorStar(dictFunctor) {
  return new Data_Profunctor.Profunctor(function (f) {
    return function (g) {
      return function (v) {
        var $78 = Data_Functor.map(dictFunctor)(g);
        return function ($79) {
          return $78(v(f($79)));
        };
      };
    };
  });
};

var strongStar = function strongStar(dictFunctor) {
  return new Data_Profunctor_Strong.Strong(function () {
    return profunctorStar(dictFunctor);
  }, function (v) {
    return function (v1) {
      return Data_Functor.map(dictFunctor)(function (v2) {
        return new Data_Tuple.Tuple(v2, v1.value1);
      })(v(v1.value0));
    };
  }, function (v) {
    return function (v1) {
      return Data_Functor.map(dictFunctor)(Data_Tuple.Tuple.create(v1.value0))(v(v1.value1));
    };
  });
};

var newtypeStar = new Data_Newtype.Newtype(function (n) {
  return n;
}, Star);

var invariantStar = function invariantStar(dictInvariant) {
  return new Data_Functor_Invariant.Invariant(function (f) {
    return function (g) {
      return function (v) {
        var $80 = Data_Functor_Invariant.imap(dictInvariant)(f)(g);
        return function ($81) {
          return $80(v($81));
        };
      };
    };
  });
};

var hoistStar = function hoistStar(f) {
  return function (v) {
    return function ($82) {
      return f(v($82));
    };
  };
};

var functorStar = function functorStar(dictFunctor) {
  return new Data_Functor.Functor(function (f) {
    return function (v) {
      var $83 = Data_Functor.map(dictFunctor)(f);
      return function ($84) {
        return $83(v($84));
      };
    };
  });
};

var distributiveStar = function distributiveStar(dictDistributive) {
  return new Data_Distributive.Distributive(function () {
    return functorStar(dictDistributive.Functor0());
  }, function (dictFunctor) {
    return function (f) {
      var $85 = Data_Distributive.distribute(distributiveStar(dictDistributive))(dictFunctor);
      var $86 = Data_Functor.map(dictFunctor)(f);
      return function ($87) {
        return $85($86($87));
      };
    };
  }, function (dictFunctor) {
    return function (f) {
      return function (a) {
        return Data_Distributive.collect(dictDistributive)(dictFunctor)(function (v) {
          return v(a);
        })(f);
      };
    };
  });
};

var closedStar = function closedStar(dictDistributive) {
  return new Data_Profunctor_Closed.Closed(function () {
    return profunctorStar(dictDistributive.Functor0());
  }, function (v) {
    return function (g) {
      return Data_Distributive.distribute(dictDistributive)(Data_Functor.functorFn)(function ($88) {
        return v(g($88));
      });
    };
  });
};

var choiceStar = function choiceStar(dictApplicative) {
  return new Data_Profunctor_Choice.Choice(function () {
    return profunctorStar(dictApplicative.Apply0().Functor0());
  }, function (v) {
    return Star(Data_Either.either(function () {
      var $89 = Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Either.Left.create);
      return function ($90) {
        return $89(v($90));
      };
    }())(function () {
      var $91 = Control_Applicative.pure(dictApplicative);
      return function ($92) {
        return $91(Data_Either.Right.create($92));
      };
    }()));
  }, function (v) {
    return Star(Data_Either.either(function () {
      var $93 = Control_Applicative.pure(dictApplicative);
      return function ($94) {
        return $93(Data_Either.Left.create($94));
      };
    }())(function () {
      var $95 = Data_Functor.map(dictApplicative.Apply0().Functor0())(Data_Either.Right.create);
      return function ($96) {
        return $95(v($96));
      };
    }()));
  });
};

var categoryStar = function categoryStar(dictMonad) {
  return new Control_Category.Category(function () {
    return semigroupoidStar(dictMonad.Bind1());
  }, Control_Applicative.pure(dictMonad.Applicative0()));
};

var applyStar = function applyStar(dictApply) {
  return new Control_Apply.Apply(function () {
    return functorStar(dictApply.Functor0());
  }, function (v) {
    return function (v1) {
      return function (a) {
        return Control_Apply.apply(dictApply)(v(a))(v1(a));
      };
    };
  });
};

var bindStar = function bindStar(dictBind) {
  return new Control_Bind.Bind(function () {
    return applyStar(dictBind.Apply0());
  }, function (v) {
    return function (f) {
      return function (x) {
        return Control_Bind.bind(dictBind)(v(x))(function (a) {
          var v1 = f(a);
          return v1(x);
        });
      };
    };
  });
};

var applicativeStar = function applicativeStar(dictApplicative) {
  return new Control_Applicative.Applicative(function () {
    return applyStar(dictApplicative.Apply0());
  }, function (a) {
    return function (v) {
      return Control_Applicative.pure(dictApplicative)(a);
    };
  });
};

var monadStar = function monadStar(dictMonad) {
  return new Control_Monad.Monad(function () {
    return applicativeStar(dictMonad.Applicative0());
  }, function () {
    return bindStar(dictMonad.Bind1());
  });
};

var altStar = function altStar(dictAlt) {
  return new Control_Alt.Alt(function () {
    return functorStar(dictAlt.Functor0());
  }, function (v) {
    return function (v1) {
      return function (a) {
        return Control_Alt.alt(dictAlt)(v(a))(v1(a));
      };
    };
  });
};

var plusStar = function plusStar(dictPlus) {
  return new Control_Plus.Plus(function () {
    return altStar(dictPlus.Alt0());
  }, function (v) {
    return Control_Plus.empty(dictPlus);
  });
};

var alternativeStar = function alternativeStar(dictAlternative) {
  return new Control_Alternative.Alternative(function () {
    return applicativeStar(dictAlternative.Applicative0());
  }, function () {
    return plusStar(dictAlternative.Plus1());
  });
};

var monadZeroStar = function monadZeroStar(dictMonadZero) {
  return new Control_MonadZero.MonadZero(function () {
    return alternativeStar(dictMonadZero.Alternative1());
  }, function () {
    return monadStar(dictMonadZero.Monad0());
  });
};

var monadPlusStar = function monadPlusStar(dictMonadPlus) {
  return new Control_MonadPlus.MonadPlus(function () {
    return monadZeroStar(dictMonadPlus.MonadZero0());
  });
};

module.exports = {
  Star: Star,
  hoistStar: hoistStar,
  newtypeStar: newtypeStar,
  semigroupoidStar: semigroupoidStar,
  categoryStar: categoryStar,
  functorStar: functorStar,
  invariantStar: invariantStar,
  applyStar: applyStar,
  applicativeStar: applicativeStar,
  bindStar: bindStar,
  monadStar: monadStar,
  altStar: altStar,
  plusStar: plusStar,
  alternativeStar: alternativeStar,
  monadZeroStar: monadZeroStar,
  monadPlusStar: monadPlusStar,
  distributiveStar: distributiveStar,
  profunctorStar: profunctorStar,
  strongStar: strongStar,
  choiceStar: choiceStar,
  closedStar: closedStar
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.MonadPlus/index.js":"../output/Control.MonadPlus/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Distributive/index.js":"../output/Data.Distributive/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Invariant/index.js":"../output/Data.Functor.Invariant/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js","../Data.Profunctor.Closed/index.js":"../output/Data.Profunctor.Closed/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Lens.Internal.Wander/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Functor = require("../Data.Functor/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var Data_Profunctor_Star = require("../Data.Profunctor.Star/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var Wander = function Wander(Choice1, Strong0, wander) {
  this.Choice1 = Choice1;
  this.Strong0 = Strong0;
  this.wander = wander;
};

var wanderStar = function wanderStar(dictApplicative) {
  return new Wander(function () {
    return Data_Profunctor_Star.choiceStar(dictApplicative);
  }, function () {
    return Data_Profunctor_Star.strongStar(dictApplicative.Apply0().Functor0());
  }, function (t) {
    return function (v) {
      return t(dictApplicative)(v);
    };
  });
};

var wanderFunction = new Wander(function () {
  return Data_Profunctor_Choice.choiceFn;
}, function () {
  return Data_Profunctor_Strong.strongFn;
}, function (t) {
  return Data_Newtype.alaF(Data_Functor.functorFn)(Data_Functor.functorFn)(Data_Identity.newtypeIdentity)(Data_Identity.newtypeIdentity)(Data_Identity.Identity)(t(Data_Identity.applicativeIdentity));
});

var wander = function wander(dict) {
  return dict.wander;
};

module.exports = {
  wander: wander,
  Wander: Wander,
  wanderFunction: wanderFunction,
  wanderStar: wanderStar
};
},{"../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js","../Data.Profunctor.Star/index.js":"../output/Data.Profunctor.Star/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js"}],"../output/Data.Lazy/foreign.js":[function(require,module,exports) {
"use strict";

exports.defer = function (thunk) {
  var v = null;
  return function () {
    if (thunk === undefined) return v;
    v = thunk();
    thunk = undefined; // eslint-disable-line no-param-reassign

    return v;
  };
};

exports.force = function (l) {
  return l();
};
},{}],"../output/Data.Lazy/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var $foreign = require("./foreign.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Comonad = require("../Control.Comonad/index.js");

var Control_Extend = require("../Control.Extend/index.js");

var Control_Lazy = require("../Control.Lazy/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Data_BooleanAlgebra = require("../Data.BooleanAlgebra/index.js");

var Data_Bounded = require("../Data.Bounded/index.js");

var Data_CommutativeRing = require("../Data.CommutativeRing/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_EuclideanRing = require("../Data.EuclideanRing/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Invariant = require("../Data.Functor.Invariant/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ring = require("../Data.Ring/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semigroup_Foldable = require("../Data.Semigroup.Foldable/index.js");

var Data_Semigroup_Traversable = require("../Data.Semigroup.Traversable/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var showLazy = function showLazy(dictShow) {
  return new Data_Show.Show(function (x) {
    return "(defer \\_ -> " + (Data_Show.show(dictShow)($foreign.force(x)) + ")");
  });
};

var semiringLazy = function semiringLazy(dictSemiring) {
  return new Data_Semiring.Semiring(function (a) {
    return function (b) {
      return $foreign.defer(function (v) {
        return Data_Semiring.add(dictSemiring)($foreign.force(a))($foreign.force(b));
      });
    };
  }, function (a) {
    return function (b) {
      return $foreign.defer(function (v) {
        return Data_Semiring.mul(dictSemiring)($foreign.force(a))($foreign.force(b));
      });
    };
  }, $foreign.defer(function (v) {
    return Data_Semiring.one(dictSemiring);
  }), $foreign.defer(function (v) {
    return Data_Semiring.zero(dictSemiring);
  }));
};

var semigroupLazy = function semigroupLazy(dictSemigroup) {
  return new Data_Semigroup.Semigroup(function (a) {
    return function (b) {
      return $foreign.defer(function (v) {
        return Data_Semigroup.append(dictSemigroup)($foreign.force(a))($foreign.force(b));
      });
    };
  });
};

var ringLazy = function ringLazy(dictRing) {
  return new Data_Ring.Ring(function () {
    return semiringLazy(dictRing.Semiring0());
  }, function (a) {
    return function (b) {
      return $foreign.defer(function (v) {
        return Data_Ring.sub(dictRing)($foreign.force(a))($foreign.force(b));
      });
    };
  });
};

var monoidLazy = function monoidLazy(dictMonoid) {
  return new Data_Monoid.Monoid(function () {
    return semigroupLazy(dictMonoid.Semigroup0());
  }, $foreign.defer(function (v) {
    return Data_Monoid.mempty(dictMonoid);
  }));
};

var lazyLazy = new Control_Lazy.Lazy(function (f) {
  return $foreign.defer(function (v) {
    return $foreign.force(f(Data_Unit.unit));
  });
});
var functorLazy = new Data_Functor.Functor(function (f) {
  return function (l) {
    return $foreign.defer(function (v) {
      return f($foreign.force(l));
    });
  };
});
var functorWithIndexLazy = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorLazy;
}, function (f) {
  return Data_Functor.map(functorLazy)(f(Data_Unit.unit));
});
var invariantLazy = new Data_Functor_Invariant.Invariant(Data_Functor_Invariant.imapF(functorLazy));
var foldableLazy = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return function (l) {
      return f($foreign.force(l));
    };
  };
}, function (f) {
  return function (z) {
    return function (l) {
      return f(z)($foreign.force(l));
    };
  };
}, function (f) {
  return function (z) {
    return function (l) {
      return f($foreign.force(l))(z);
    };
  };
});
var foldableWithIndexLazy = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableLazy;
}, function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldMap(foldableLazy)(dictMonoid)(f(Data_Unit.unit));
  };
}, function (f) {
  return Data_Foldable.foldl(foldableLazy)(f(Data_Unit.unit));
}, function (f) {
  return Data_Foldable.foldr(foldableLazy)(f(Data_Unit.unit));
});
var traversableLazy = new Data_Traversable.Traversable(function () {
  return foldableLazy;
}, function () {
  return functorLazy;
}, function (dictApplicative) {
  return function (l) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(function ($42) {
      return $foreign.defer(Data_Function["const"]($42));
    })($foreign.force(l));
  };
}, function (dictApplicative) {
  return function (f) {
    return function (l) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(function ($43) {
        return $foreign.defer(Data_Function["const"]($43));
      })(f($foreign.force(l)));
    };
  };
});
var traversableWithIndexLazy = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexLazy;
}, function () {
  return functorWithIndexLazy;
}, function () {
  return traversableLazy;
}, function (dictApplicative) {
  return function (f) {
    return Data_Traversable.traverse(traversableLazy)(dictApplicative)(f(Data_Unit.unit));
  };
});
var foldable1Lazy = new Data_Semigroup_Foldable.Foldable1(function () {
  return foldableLazy;
}, function (dictSemigroup) {
  return Data_Semigroup_Foldable.fold1Default(foldable1Lazy)(dictSemigroup);
}, function (dictSemigroup) {
  return function (f) {
    return function (l) {
      return f($foreign.force(l));
    };
  };
});
var traversable1Lazy = new Data_Semigroup_Traversable.Traversable1(function () {
  return foldable1Lazy;
}, function () {
  return traversableLazy;
}, function (dictApply) {
  return function (l) {
    return Data_Functor.map(dictApply.Functor0())(function ($44) {
      return $foreign.defer(Data_Function["const"]($44));
    })($foreign.force(l));
  };
}, function (dictApply) {
  return function (f) {
    return function (l) {
      return Data_Functor.map(dictApply.Functor0())(function ($45) {
        return $foreign.defer(Data_Function["const"]($45));
      })(f($foreign.force(l)));
    };
  };
});
var extendLazy = new Control_Extend.Extend(function () {
  return functorLazy;
}, function (f) {
  return function (x) {
    return $foreign.defer(function (v) {
      return f(x);
    });
  };
});

var eqLazy = function eqLazy(dictEq) {
  return new Data_Eq.Eq(function (x) {
    return function (y) {
      return Data_Eq.eq(dictEq)($foreign.force(x))($foreign.force(y));
    };
  });
};

var ordLazy = function ordLazy(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqLazy(dictOrd.Eq0());
  }, function (x) {
    return function (y) {
      return Data_Ord.compare(dictOrd)($foreign.force(x))($foreign.force(y));
    };
  });
};

var eq1Lazy = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqLazy(dictEq));
});
var ord1Lazy = new Data_Ord.Ord1(function () {
  return eq1Lazy;
}, function (dictOrd) {
  return Data_Ord.compare(ordLazy(dictOrd));
});
var comonadLazy = new Control_Comonad.Comonad(function () {
  return extendLazy;
}, $foreign.force);

var commutativeRingLazy = function commutativeRingLazy(dictCommutativeRing) {
  return new Data_CommutativeRing.CommutativeRing(function () {
    return ringLazy(dictCommutativeRing.Ring0());
  });
};

var euclideanRingLazy = function euclideanRingLazy(dictEuclideanRing) {
  return new Data_EuclideanRing.EuclideanRing(function () {
    return commutativeRingLazy(dictEuclideanRing.CommutativeRing0());
  }, function () {
    var $46 = Data_EuclideanRing.degree(dictEuclideanRing);
    return function ($47) {
      return $46($foreign.force($47));
    };
  }(), function (a) {
    return function (b) {
      return $foreign.defer(function (v) {
        return Data_EuclideanRing.div(dictEuclideanRing)($foreign.force(a))($foreign.force(b));
      });
    };
  }, function (a) {
    return function (b) {
      return $foreign.defer(function (v) {
        return Data_EuclideanRing.mod(dictEuclideanRing)($foreign.force(a))($foreign.force(b));
      });
    };
  });
};

var boundedLazy = function boundedLazy(dictBounded) {
  return new Data_Bounded.Bounded(function () {
    return ordLazy(dictBounded.Ord0());
  }, $foreign.defer(function (v) {
    return Data_Bounded.bottom(dictBounded);
  }), $foreign.defer(function (v) {
    return Data_Bounded.top(dictBounded);
  }));
};

var applyLazy = new Control_Apply.Apply(function () {
  return functorLazy;
}, function (f) {
  return function (x) {
    return $foreign.defer(function (v) {
      return $foreign.force(f)($foreign.force(x));
    });
  };
});
var bindLazy = new Control_Bind.Bind(function () {
  return applyLazy;
}, function (l) {
  return function (f) {
    return $foreign.defer(function (v) {
      return $foreign.force(f($foreign.force(l)));
    });
  };
});

var heytingAlgebraLazy = function heytingAlgebraLazy(dictHeytingAlgebra) {
  return new Data_HeytingAlgebra.HeytingAlgebra(function (a) {
    return function (b) {
      return Control_Apply.apply(applyLazy)(Data_Functor.map(functorLazy)(Data_HeytingAlgebra.conj(dictHeytingAlgebra))(a))(b);
    };
  }, function (a) {
    return function (b) {
      return Control_Apply.apply(applyLazy)(Data_Functor.map(functorLazy)(Data_HeytingAlgebra.disj(dictHeytingAlgebra))(a))(b);
    };
  }, $foreign.defer(function (v) {
    return Data_HeytingAlgebra.ff(dictHeytingAlgebra);
  }), function (a) {
    return function (b) {
      return Control_Apply.apply(applyLazy)(Data_Functor.map(functorLazy)(Data_HeytingAlgebra.implies(dictHeytingAlgebra))(a))(b);
    };
  }, function (a) {
    return Data_Functor.map(functorLazy)(Data_HeytingAlgebra.not(dictHeytingAlgebra))(a);
  }, $foreign.defer(function (v) {
    return Data_HeytingAlgebra.tt(dictHeytingAlgebra);
  }));
};

var booleanAlgebraLazy = function booleanAlgebraLazy(dictBooleanAlgebra) {
  return new Data_BooleanAlgebra.BooleanAlgebra(function () {
    return heytingAlgebraLazy(dictBooleanAlgebra.HeytingAlgebra0());
  });
};

var applicativeLazy = new Control_Applicative.Applicative(function () {
  return applyLazy;
}, function (a) {
  return $foreign.defer(function (v) {
    return a;
  });
});
var monadLazy = new Control_Monad.Monad(function () {
  return applicativeLazy;
}, function () {
  return bindLazy;
});
module.exports = {
  semiringLazy: semiringLazy,
  ringLazy: ringLazy,
  commutativeRingLazy: commutativeRingLazy,
  euclideanRingLazy: euclideanRingLazy,
  eqLazy: eqLazy,
  eq1Lazy: eq1Lazy,
  ordLazy: ordLazy,
  ord1Lazy: ord1Lazy,
  boundedLazy: boundedLazy,
  semigroupLazy: semigroupLazy,
  monoidLazy: monoidLazy,
  heytingAlgebraLazy: heytingAlgebraLazy,
  booleanAlgebraLazy: booleanAlgebraLazy,
  functorLazy: functorLazy,
  functorWithIndexLazy: functorWithIndexLazy,
  foldableLazy: foldableLazy,
  foldableWithIndexLazy: foldableWithIndexLazy,
  foldable1Lazy: foldable1Lazy,
  traversableLazy: traversableLazy,
  traversableWithIndexLazy: traversableWithIndexLazy,
  traversable1Lazy: traversable1Lazy,
  invariantLazy: invariantLazy,
  applyLazy: applyLazy,
  applicativeLazy: applicativeLazy,
  bindLazy: bindLazy,
  monadLazy: monadLazy,
  extendLazy: extendLazy,
  comonadLazy: comonadLazy,
  showLazy: showLazy,
  lazyLazy: lazyLazy,
  defer: $foreign.defer,
  force: $foreign.force
};
},{"./foreign.js":"../output/Data.Lazy/foreign.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Comonad/index.js":"../output/Control.Comonad/index.js","../Control.Extend/index.js":"../output/Control.Extend/index.js","../Control.Lazy/index.js":"../output/Control.Lazy/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Data.BooleanAlgebra/index.js":"../output/Data.BooleanAlgebra/index.js","../Data.Bounded/index.js":"../output/Data.Bounded/index.js","../Data.CommutativeRing/index.js":"../output/Data.CommutativeRing/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.EuclideanRing/index.js":"../output/Data.EuclideanRing/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Invariant/index.js":"../output/Data.Functor.Invariant/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ring/index.js":"../output/Data.Ring/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semigroup.Foldable/index.js":"../output/Data.Semigroup.Foldable/index.js","../Data.Semigroup.Traversable/index.js":"../output/Data.Semigroup.Traversable/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.List.Lazy.Types/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Alternative = require("../Control.Alternative/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Comonad = require("../Control.Comonad/index.js");

var Control_Extend = require("../Control.Extend/index.js");

var Control_Lazy = require("../Control.Lazy/index.js");

var Control_Monad = require("../Control.Monad/index.js");

var Control_MonadPlus = require("../Control.MonadPlus/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Control_Plus = require("../Control.Plus/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Lazy = require("../Data.Lazy/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_NonEmpty = require("../Data.NonEmpty/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Semiring = require("../Data.Semiring/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Data_Unfoldable1 = require("../Data.Unfoldable1/index.js");

var List = function List(x) {
  return x;
};

var Nil = function () {
  function Nil() {}

  ;
  Nil.value = new Nil();
  return Nil;
}();

var Cons = function () {
  function Cons(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Cons.create = function (value0) {
    return function (value1) {
      return new Cons(value0, value1);
    };
  };

  return Cons;
}();

var NonEmptyList = function NonEmptyList(x) {
  return x;
};

var nil = List(Data_Lazy.defer(function (v) {
  return Nil.value;
}));
var newtypeNonEmptyList = new Data_Newtype.Newtype(function (n) {
  return n;
}, NonEmptyList);
var newtypeList = new Data_Newtype.Newtype(function (n) {
  return n;
}, List);

var step = function () {
  var $215 = Data_Newtype.unwrap(newtypeList);
  return function ($216) {
    return Data_Lazy.force($215($216));
  };
}();

var semigroupList = new Data_Semigroup.Semigroup(function (xs) {
  return function (ys) {
    var go = function go(v) {
      if (v instanceof Nil) {
        return step(ys);
      }

      ;

      if (v instanceof Cons) {
        return new Cons(v.value0, Data_Semigroup.append(semigroupList)(v.value1)(ys));
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy.Types (line 98, column 5 - line 98, column 21): " + [v.constructor.name]);
    };

    return Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(newtypeList)(xs));
  };
});

var showList = function showList(dictShow) {
  return new Data_Show.Show(function (xs) {
    var go = function go(v) {
      if (v instanceof Nil) {
        return "Nil";
      }

      ;

      if (v instanceof Cons) {
        return "(Cons " + (Data_Show.show(dictShow)(v.value0) + (" " + (go(step(v.value1)) + ")")));
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy.Types (line 64, column 5 - line 64, column 19): " + [v.constructor.name]);
    };

    return "fromStrict (" + (go(step(xs)) + ")");
  });
};

var showNonEmptyList = function showNonEmptyList(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(NonEmptyList " + (Data_Show.show(Data_Lazy.showLazy(Data_NonEmpty.showNonEmpty(dictShow)(showList(dictShow))))(v) + ")");
  });
};

var monoidList = new Data_Monoid.Monoid(function () {
  return semigroupList;
}, nil);
var lazyList = new Control_Lazy.Lazy(function (f) {
  return List(Data_Lazy.defer(function ($217) {
    return step(f($217));
  }));
});
var functorList = new Data_Functor.Functor(function (f) {
  return function (xs) {
    var go = function go(v) {
      if (v instanceof Nil) {
        return Nil.value;
      }

      ;

      if (v instanceof Cons) {
        return new Cons(f(v.value0), Data_Functor.map(functorList)(f)(v.value1));
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy.Types (line 107, column 5 - line 107, column 17): " + [v.constructor.name]);
    };

    return Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(newtypeList)(xs));
  };
});
var functorNonEmptyList = new Data_Functor.Functor(function (f) {
  return function (v) {
    return Data_Functor.map(Data_Lazy.functorLazy)(Data_Functor.map(Data_NonEmpty.functorNonEmpty(functorList))(f))(v);
  };
});
var eq1List = new Data_Eq.Eq1(function (dictEq) {
  return function (xs) {
    return function (ys) {
      var go = function go($copy_v) {
        return function ($copy_v1) {
          var $tco_var_v = $copy_v;
          var $tco_done = false;
          var $tco_result;

          function $tco_loop(v, v1) {
            if (v instanceof Nil && v1 instanceof Nil) {
              $tco_done = true;
              return true;
            }

            ;

            if (v instanceof Cons && v1 instanceof Cons && Data_Eq.eq(dictEq)(v.value0)(v1.value0)) {
              $tco_var_v = step(v.value1);
              $copy_v1 = step(v1.value1);
              return;
            }

            ;
            $tco_done = true;
            return false;
          }

          ;

          while (!$tco_done) {
            $tco_result = $tco_loop($tco_var_v, $copy_v1);
          }

          ;
          return $tco_result;
        };
      };

      return go(step(xs))(step(ys));
    };
  };
});

var eqList = function eqList(dictEq) {
  return new Data_Eq.Eq(Data_Eq.eq1(eq1List)(dictEq));
};

var eqNonEmptyList = function eqNonEmptyList(dictEq) {
  return Data_Lazy.eqLazy(Data_NonEmpty.eqNonEmpty(eq1List)(dictEq));
};

var ord1List = new Data_Ord.Ord1(function () {
  return eq1List;
}, function (dictOrd) {
  return function (xs) {
    return function (ys) {
      var go = function go($copy_v) {
        return function ($copy_v1) {
          var $tco_var_v = $copy_v;
          var $tco_done = false;
          var $tco_result;

          function $tco_loop(v, v1) {
            if (v instanceof Nil && v1 instanceof Nil) {
              $tco_done = true;
              return Data_Ordering.EQ.value;
            }

            ;

            if (v instanceof Nil) {
              $tco_done = true;
              return Data_Ordering.LT.value;
            }

            ;

            if (v1 instanceof Nil) {
              $tco_done = true;
              return Data_Ordering.GT.value;
            }

            ;

            if (v instanceof Cons && v1 instanceof Cons) {
              var v2 = Data_Ord.compare(dictOrd)(v.value0)(v1.value0);

              if (v2 instanceof Data_Ordering.EQ) {
                $tco_var_v = step(v.value1);
                $copy_v1 = step(v1.value1);
                return;
              }

              ;
              $tco_done = true;
              return v2;
            }

            ;
            throw new Error("Failed pattern match at Data.List.Lazy.Types (line 84, column 5 - line 84, column 20): " + [v.constructor.name, v1.constructor.name]);
          }

          ;

          while (!$tco_done) {
            $tco_result = $tco_loop($tco_var_v, $copy_v1);
          }

          ;
          return $tco_result;
        };
      };

      return go(step(xs))(step(ys));
    };
  };
});

var ordList = function ordList(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqList(dictOrd.Eq0());
  }, Data_Ord.compare1(ord1List)(dictOrd));
};

var ordNonEmptyList = function ordNonEmptyList(dictOrd) {
  return Data_Lazy.ordLazy(Data_NonEmpty.ordNonEmpty(ord1List)(dictOrd));
};

var cons = function cons(x) {
  return function (xs) {
    return List(Data_Lazy.defer(function (v) {
      return new Cons(x, xs);
    }));
  };
};

var foldableList = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return Data_Foldable.foldl(foldableList)(function (b) {
      return function (a) {
        return Data_Semigroup.append(dictMonoid.Semigroup0())(b)(f(a));
      };
    })(Data_Monoid.mempty(dictMonoid));
  };
}, function (op) {
  var go = function go($copy_b) {
    return function ($copy_xs) {
      var $tco_var_b = $copy_b;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(b, xs) {
        var v = step(xs);

        if (v instanceof Nil) {
          $tco_done = true;
          return b;
        }

        ;

        if (v instanceof Cons) {
          $tco_var_b = op(b)(v.value0);
          $copy_xs = v.value1;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy.Types (line 122, column 7 - line 124, column 40): " + [v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_b, $copy_xs);
      }

      ;
      return $tco_result;
    };
  };

  return go;
}, function (op) {
  return function (z) {
    return function (xs) {
      var rev = Data_Foldable.foldl(foldableList)(Data_Function.flip(cons))(nil);
      return Data_Foldable.foldl(foldableList)(Data_Function.flip(op))(z)(rev(xs));
    };
  };
});
var extendList = new Control_Extend.Extend(function () {
  return functorList;
}, function (f) {
  return function (l) {
    var go = function go(a) {
      return function (v) {
        var acc$prime = cons(a)(v.acc);
        return {
          val: cons(f(acc$prime))(v.val),
          acc: acc$prime
        };
      };
    };

    var v = step(l);

    if (v instanceof Nil) {
      return nil;
    }

    ;

    if (v instanceof Cons) {
      return cons(f(l))(Data_Foldable.foldr(foldableList)(go)({
        val: nil,
        acc: nil
      })(v.value1).val);
    }

    ;
    throw new Error("Failed pattern match at Data.List.Lazy.Types (line 194, column 5 - line 197, column 55): " + [v.constructor.name]);
  };
});
var extendNonEmptyList = new Control_Extend.Extend(function () {
  return functorNonEmptyList;
}, function (f) {
  return function (v) {
    var go = function go(a) {
      return function (v1) {
        return {
          val: cons(f(Data_Lazy.defer(function (v2) {
            return new Data_NonEmpty.NonEmpty(a, v1.acc);
          })))(v1.val),
          acc: cons(a)(v1.acc)
        };
      };
    };

    var v1 = Data_Lazy.force(v);
    return NonEmptyList(Data_Lazy.defer(function (v2) {
      return new Data_NonEmpty.NonEmpty(f(v), Data_Foldable.foldr(foldableList)(go)({
        val: nil,
        acc: nil
      })(v1.value1).val);
    }));
  };
});
var foldableNonEmptyList = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return Data_Foldable.foldMap(Data_NonEmpty.foldableNonEmpty(foldableList))(dictMonoid)(f)(Data_Lazy.force(v));
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return Data_Foldable.foldl(Data_NonEmpty.foldableNonEmpty(foldableList))(f)(b)(Data_Lazy.force(v));
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return Data_Foldable.foldr(Data_NonEmpty.foldableNonEmpty(foldableList))(f)(b)(Data_Lazy.force(v));
    };
  };
});
var foldableWithIndexList = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableList;
}, function (dictMonoid) {
  return function (f) {
    return Data_FoldableWithIndex.foldlWithIndex(foldableWithIndexList)(function (i) {
      return function (acc) {
        var $218 = Data_Semigroup.append(dictMonoid.Semigroup0())(acc);
        var $219 = f(i);
        return function ($220) {
          return $218($219($220));
        };
      };
    })(Data_Monoid.mempty(dictMonoid));
  };
}, function (f) {
  return function (acc) {
    var $221 = Data_Foldable.foldl(foldableList)(function (v) {
      return function (a) {
        return new Data_Tuple.Tuple(v.value0 + 1 | 0, f(v.value0)(v.value1)(a));
      };
    })(new Data_Tuple.Tuple(0, acc));
    return function ($222) {
      return Data_Tuple.snd($221($222));
    };
  };
}, function (f) {
  return function (b) {
    return function (xs) {
      var v = function () {
        var rev = Data_Foldable.foldl(foldableList)(function (v1) {
          return function (a) {
            return new Data_Tuple.Tuple(v1.value0 + 1 | 0, cons(a)(v1.value1));
          };
        });
        return rev(new Data_Tuple.Tuple(0, nil))(xs);
      }();

      return Data_Tuple.snd(Data_Foldable.foldl(foldableList)(function (v1) {
        return function (a) {
          return new Data_Tuple.Tuple(v1.value0 - 1 | 0, f(v1.value0 - 1 | 0)(a)(v1.value1));
        };
      })(new Data_Tuple.Tuple(v.value0, b))(v.value1));
    };
  };
});
var foldableWithIndexNonEmptyList = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableNonEmptyList;
}, function (dictMonoid) {
  return function (f) {
    return function (v) {
      return Data_FoldableWithIndex.foldMapWithIndex(Data_NonEmpty.foldableWithIndexNonEmpty(foldableWithIndexList))(dictMonoid)(function () {
        var $223 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($224) {
          return f($223($224));
        };
      }())(Data_Lazy.force(v));
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return Data_FoldableWithIndex.foldlWithIndex(Data_NonEmpty.foldableWithIndexNonEmpty(foldableWithIndexList))(function () {
        var $225 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($226) {
          return f($225($226));
        };
      }())(b)(Data_Lazy.force(v));
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return Data_FoldableWithIndex.foldrWithIndex(Data_NonEmpty.foldableWithIndexNonEmpty(foldableWithIndexList))(function () {
        var $227 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($228) {
          return f($227($228));
        };
      }())(b)(Data_Lazy.force(v));
    };
  };
});
var functorWithIndexList = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorList;
}, function (f) {
  return Data_FoldableWithIndex.foldrWithIndex(foldableWithIndexList)(function (i) {
    return function (x) {
      return function (acc) {
        return cons(f(i)(x))(acc);
      };
    };
  })(nil);
});
var functorWithIndexNonEmptyList = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorNonEmptyList;
}, function (f) {
  return function (v) {
    return NonEmptyList(Data_Lazy.defer(function (v1) {
      return Data_FunctorWithIndex.mapWithIndex(Data_NonEmpty.functorWithIndex(functorWithIndexList))(function () {
        var $229 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($230) {
          return f($229($230));
        };
      }())(Data_Lazy.force(v));
    }));
  };
});

var toList = function toList(v) {
  return Control_Lazy.defer(lazyList)(function (v1) {
    var v2 = Data_Lazy.force(v);
    return cons(v2.value0)(v2.value1);
  });
};

var semigroupNonEmptyList = new Data_Semigroup.Semigroup(function (v) {
  return function (as$prime) {
    var v1 = Data_Lazy.force(v);
    return Data_Lazy.defer(function (v2) {
      return new Data_NonEmpty.NonEmpty(v1.value0, Data_Semigroup.append(semigroupList)(v1.value1)(toList(as$prime)));
    });
  };
});
var traversableList = new Data_Traversable.Traversable(function () {
  return foldableList;
}, function () {
  return functorList;
}, function (dictApplicative) {
  return Data_Traversable.traverse(traversableList)(dictApplicative)(Control_Category.identity(Control_Category.categoryFn));
}, function (dictApplicative) {
  return function (f) {
    return Data_Foldable.foldr(foldableList)(function (a) {
      return function (b) {
        return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(cons)(f(a)))(b);
      };
    })(Control_Applicative.pure(dictApplicative)(nil));
  };
});
var traversableNonEmptyList = new Data_Traversable.Traversable(function () {
  return foldableNonEmptyList;
}, function () {
  return functorNonEmptyList;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(function (xxs) {
      return NonEmptyList(Data_Lazy.defer(function (v1) {
        return xxs;
      }));
    })(Data_Traversable.sequence(Data_NonEmpty.traversableNonEmpty(traversableList))(dictApplicative)(Data_Lazy.force(v)));
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(function (xxs) {
        return NonEmptyList(Data_Lazy.defer(function (v1) {
          return xxs;
        }));
      })(Data_Traversable.traverse(Data_NonEmpty.traversableNonEmpty(traversableList))(dictApplicative)(f)(Data_Lazy.force(v)));
    };
  };
});
var traversableWithIndexList = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexList;
}, function () {
  return functorWithIndexList;
}, function () {
  return traversableList;
}, function (dictApplicative) {
  return function (f) {
    return Data_FoldableWithIndex.foldrWithIndex(foldableWithIndexList)(function (i) {
      return function (a) {
        return function (b) {
          return Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(cons)(f(i)(a)))(b);
        };
      };
    })(Control_Applicative.pure(dictApplicative)(nil));
  };
});
var traversableWithIndexNonEmptyList = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexNonEmptyList;
}, function () {
  return functorWithIndexNonEmptyList;
}, function () {
  return traversableNonEmptyList;
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(function (xxs) {
        return NonEmptyList(Data_Lazy.defer(function (v1) {
          return xxs;
        }));
      })(Data_TraversableWithIndex.traverseWithIndex(Data_NonEmpty.traversableWithIndexNonEmpty(traversableWithIndexList))(dictApplicative)(function () {
        var $231 = Data_Maybe.maybe(0)(Data_Semiring.add(Data_Semiring.semiringInt)(1));
        return function ($232) {
          return f($231($232));
        };
      }())(Data_Lazy.force(v)));
    };
  };
});
var unfoldable1List = new Data_Unfoldable1.Unfoldable1(function () {
  var go = function go(f) {
    return function (b) {
      return Control_Lazy.defer(lazyList)(function (v) {
        var v1 = f(b);

        if (v1.value1 instanceof Data_Maybe.Just) {
          return cons(v1.value0)(go(f)(v1.value1.value0));
        }

        ;

        if (v1.value1 instanceof Data_Maybe.Nothing) {
          return cons(v1.value0)(nil);
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy.Types (line 146, column 28 - line 148, column 33): " + [v1.constructor.name]);
      });
    };
  };

  return go;
}());
var unfoldableList = new Data_Unfoldable.Unfoldable(function () {
  return unfoldable1List;
}, function () {
  var go = function go(f) {
    return function (b) {
      return Control_Lazy.defer(lazyList)(function (v) {
        var v1 = f(b);

        if (v1 instanceof Data_Maybe.Nothing) {
          return nil;
        }

        ;

        if (v1 instanceof Data_Maybe.Just) {
          return cons(v1.value0.value0)(go(f)(v1.value0.value1));
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy.Types (line 152, column 28 - line 154, column 39): " + [v1.constructor.name]);
      });
    };
  };

  return go;
}());
var unfoldable1NonEmptyList = new Data_Unfoldable1.Unfoldable1(function (f) {
  return function (b) {
    return NonEmptyList(Data_Lazy.defer(function (v) {
      return Data_Unfoldable1.unfoldr1(Data_NonEmpty.unfoldable1NonEmpty(unfoldableList))(f)(b);
    }));
  };
});
var comonadNonEmptyList = new Control_Comonad.Comonad(function () {
  return extendNonEmptyList;
}, function (v) {
  return Data_NonEmpty.head(Data_Lazy.force(v));
});
var monadList = new Control_Monad.Monad(function () {
  return applicativeList;
}, function () {
  return bindList;
});
var bindList = new Control_Bind.Bind(function () {
  return applyList;
}, function (xs) {
  return function (f) {
    var go = function go(v) {
      if (v instanceof Nil) {
        return Nil.value;
      }

      ;

      if (v instanceof Cons) {
        return step(Data_Semigroup.append(semigroupList)(f(v.value0))(Control_Bind.bind(bindList)(v.value1)(f)));
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy.Types (line 175, column 5 - line 175, column 17): " + [v.constructor.name]);
    };

    return Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(newtypeList)(xs));
  };
});
var applyList = new Control_Apply.Apply(function () {
  return functorList;
}, Control_Monad.ap(monadList));
var applicativeList = new Control_Applicative.Applicative(function () {
  return applyList;
}, function (a) {
  return cons(a)(nil);
});
var applyNonEmptyList = new Control_Apply.Apply(function () {
  return functorNonEmptyList;
}, function (v) {
  return function (v1) {
    var v2 = Data_Lazy.force(v1);
    var v3 = Data_Lazy.force(v);
    return Data_Lazy.defer(function (v4) {
      return new Data_NonEmpty.NonEmpty(v3.value0(v2.value0), Data_Semigroup.append(semigroupList)(Control_Apply.apply(applyList)(v3.value1)(cons(v2.value0)(nil)))(Control_Apply.apply(applyList)(cons(v3.value0)(v3.value1))(v2.value1)));
    });
  };
});
var bindNonEmptyList = new Control_Bind.Bind(function () {
  return applyNonEmptyList;
}, function (v) {
  return function (f) {
    var v1 = Data_Lazy.force(v);
    var v2 = Data_Lazy.force(Data_Newtype.unwrap(newtypeNonEmptyList)(f(v1.value0)));
    return Data_Lazy.defer(function (v3) {
      return new Data_NonEmpty.NonEmpty(v2.value0, Data_Semigroup.append(semigroupList)(v2.value1)(Control_Bind.bind(bindList)(v1.value1)(function ($233) {
        return toList(f($233));
      })));
    });
  };
});
var altNonEmptyList = new Control_Alt.Alt(function () {
  return functorNonEmptyList;
}, Data_Semigroup.append(semigroupNonEmptyList));
var altList = new Control_Alt.Alt(function () {
  return functorList;
}, Data_Semigroup.append(semigroupList));
var plusList = new Control_Plus.Plus(function () {
  return altList;
}, nil);
var alternativeList = new Control_Alternative.Alternative(function () {
  return applicativeList;
}, function () {
  return plusList;
});
var monadZeroList = new Control_MonadZero.MonadZero(function () {
  return alternativeList;
}, function () {
  return monadList;
});
var monadPlusList = new Control_MonadPlus.MonadPlus(function () {
  return monadZeroList;
});
var applicativeNonEmptyList = new Control_Applicative.Applicative(function () {
  return applyNonEmptyList;
}, function (a) {
  return Data_Lazy.defer(function (v) {
    return Data_NonEmpty.singleton(plusList)(a);
  });
});
var monadNonEmptyList = new Control_Monad.Monad(function () {
  return applicativeNonEmptyList;
}, function () {
  return bindNonEmptyList;
});
module.exports = {
  List: List,
  Nil: Nil,
  Cons: Cons,
  step: step,
  nil: nil,
  cons: cons,
  NonEmptyList: NonEmptyList,
  toList: toList,
  newtypeList: newtypeList,
  showList: showList,
  eqList: eqList,
  eq1List: eq1List,
  ordList: ordList,
  ord1List: ord1List,
  lazyList: lazyList,
  semigroupList: semigroupList,
  monoidList: monoidList,
  functorList: functorList,
  functorWithIndexList: functorWithIndexList,
  foldableList: foldableList,
  foldableWithIndexList: foldableWithIndexList,
  unfoldable1List: unfoldable1List,
  unfoldableList: unfoldableList,
  traversableList: traversableList,
  traversableWithIndexList: traversableWithIndexList,
  applyList: applyList,
  applicativeList: applicativeList,
  bindList: bindList,
  monadList: monadList,
  altList: altList,
  plusList: plusList,
  alternativeList: alternativeList,
  monadZeroList: monadZeroList,
  monadPlusList: monadPlusList,
  extendList: extendList,
  newtypeNonEmptyList: newtypeNonEmptyList,
  eqNonEmptyList: eqNonEmptyList,
  ordNonEmptyList: ordNonEmptyList,
  showNonEmptyList: showNonEmptyList,
  functorNonEmptyList: functorNonEmptyList,
  applyNonEmptyList: applyNonEmptyList,
  applicativeNonEmptyList: applicativeNonEmptyList,
  bindNonEmptyList: bindNonEmptyList,
  monadNonEmptyList: monadNonEmptyList,
  altNonEmptyList: altNonEmptyList,
  extendNonEmptyList: extendNonEmptyList,
  comonadNonEmptyList: comonadNonEmptyList,
  semigroupNonEmptyList: semigroupNonEmptyList,
  foldableNonEmptyList: foldableNonEmptyList,
  traversableNonEmptyList: traversableNonEmptyList,
  unfoldable1NonEmptyList: unfoldable1NonEmptyList,
  functorWithIndexNonEmptyList: functorWithIndexNonEmptyList,
  foldableWithIndexNonEmptyList: foldableWithIndexNonEmptyList,
  traversableWithIndexNonEmptyList: traversableWithIndexNonEmptyList
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Alternative/index.js":"../output/Control.Alternative/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Comonad/index.js":"../output/Control.Comonad/index.js","../Control.Extend/index.js":"../output/Control.Extend/index.js","../Control.Lazy/index.js":"../output/Control.Lazy/index.js","../Control.Monad/index.js":"../output/Control.Monad/index.js","../Control.MonadPlus/index.js":"../output/Control.MonadPlus/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Control.Plus/index.js":"../output/Control.Plus/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Lazy/index.js":"../output/Data.Lazy/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.NonEmpty/index.js":"../output/Data.NonEmpty/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Semiring/index.js":"../output/Data.Semiring/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js","../Data.Unfoldable1/index.js":"../output/Data.Unfoldable1/index.js"}],"../output/Data.List.Lazy/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Alt = require("../Control.Alt/index.js");

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Category = require("../Control.Category/index.js");

var Control_Lazy = require("../Control.Lazy/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Lazy = require("../Data.Lazy/index.js");

var Data_List_Lazy_Types = require("../Data.List.Lazy.Types/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_NonEmpty = require("../Data.NonEmpty/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Pattern = function Pattern(x) {
  return x;
};

var zipWith = function zipWith(f) {
  return function (xs) {
    return function (ys) {
      var go = function go(v) {
        return function (v1) {
          if (v instanceof Data_List_Lazy_Types.Nil) {
            return Data_List_Lazy_Types.Nil.value;
          }

          ;

          if (v1 instanceof Data_List_Lazy_Types.Nil) {
            return Data_List_Lazy_Types.Nil.value;
          }

          ;

          if (v instanceof Data_List_Lazy_Types.Cons && v1 instanceof Data_List_Lazy_Types.Cons) {
            return new Data_List_Lazy_Types.Cons(f(v.value0)(v1.value0), zipWith(f)(v.value1)(v1.value1));
          }

          ;
          throw new Error("Failed pattern match at Data.List.Lazy (line 693, column 3 - line 693, column 35): " + [v.constructor.name, v1.constructor.name]);
        };
      };

      return Control_Apply.apply(Data_Lazy.applyLazy)(Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs)))(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(ys));
    };
  };
};

var zipWithA = function zipWithA(dictApplicative) {
  return function (f) {
    return function (xs) {
      return function (ys) {
        return Data_Traversable.sequence(Data_List_Lazy_Types.traversableList)(dictApplicative)(zipWith(f)(xs)(ys));
      };
    };
  };
};

var zip = zipWith(Data_Tuple.Tuple.create);

var updateAt = function updateAt(n) {
  return function (x) {
    return function (xs) {
      var go = function go(v) {
        return function (v1) {
          if (v1 instanceof Data_List_Lazy_Types.Nil) {
            return Data_List_Lazy_Types.Nil.value;
          }

          ;

          if (v === 0 && v1 instanceof Data_List_Lazy_Types.Cons) {
            return new Data_List_Lazy_Types.Cons(x, v1.value1);
          }

          ;

          if (v1 instanceof Data_List_Lazy_Types.Cons) {
            return new Data_List_Lazy_Types.Cons(v1.value0, updateAt(v - 1 | 0)(x)(v1.value1));
          }

          ;
          throw new Error("Failed pattern match at Data.List.Lazy (line 367, column 3 - line 367, column 17): " + [v.constructor.name, v1.constructor.name]);
        };
      };

      return Data_Functor.map(Data_Lazy.functorLazy)(go(n))(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs));
    };
  };
};

var unzip = Data_Foldable.foldr(Data_List_Lazy_Types.foldableList)(function (v) {
  return function (v1) {
    return new Data_Tuple.Tuple(Data_List_Lazy_Types.cons(v.value0)(v1.value0), Data_List_Lazy_Types.cons(v.value1)(v1.value1));
  };
})(new Data_Tuple.Tuple(Data_List_Lazy_Types.nil, Data_List_Lazy_Types.nil));

var uncons = function uncons(xs) {
  var v = Data_List_Lazy_Types.step(xs);

  if (v instanceof Data_List_Lazy_Types.Nil) {
    return Data_Maybe.Nothing.value;
  }

  ;

  if (v instanceof Data_List_Lazy_Types.Cons) {
    return new Data_Maybe.Just({
      head: v.value0,
      tail: v.value1
    });
  }

  ;
  throw new Error("Failed pattern match at Data.List.Lazy (line 285, column 13 - line 287, column 44): " + [v.constructor.name]);
};

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  return Data_Unfoldable.unfoldr(dictUnfoldable)(function (xs) {
    return Data_Functor.map(Data_Maybe.functorMaybe)(function (rec) {
      return new Data_Tuple.Tuple(rec.head, rec.tail);
    })(uncons(xs));
  });
};

var takeWhile = function takeWhile(p) {
  var go = function go(v) {
    if (v instanceof Data_List_Lazy_Types.Cons && p(v.value0)) {
      return new Data_List_Lazy_Types.Cons(v.value0, takeWhile(p)(v.value1));
    }

    ;
    return Data_List_Lazy_Types.Nil.value;
  };

  var $239 = Data_Functor.map(Data_Lazy.functorLazy)(go);
  var $240 = Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList);
  return function ($241) {
    return Data_List_Lazy_Types.List($239($240($241)));
  };
};

var take = function take(n) {
  var go = function go(v) {
    return function (v1) {
      if (v1 instanceof Data_List_Lazy_Types.Nil) {
        return Data_List_Lazy_Types.Nil.value;
      }

      ;

      if (v1 instanceof Data_List_Lazy_Types.Cons) {
        return new Data_List_Lazy_Types.Cons(v1.value0, take(v - 1 | 0)(v1.value1));
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy (line 517, column 3 - line 517, column 32): " + [v.constructor.name, v1.constructor.name]);
    };
  };

  var $119 = n <= 0;

  if ($119) {
    return Data_Function["const"](Data_List_Lazy_Types.nil);
  }

  ;
  var $242 = Data_Functor.map(Data_Lazy.functorLazy)(go(n));
  var $243 = Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList);
  return function ($244) {
    return Data_List_Lazy_Types.List($242($243($244)));
  };
};

var tail = function tail(xs) {
  return Data_Functor.map(Data_Maybe.functorMaybe)(function (v) {
    return v.tail;
  })(uncons(xs));
};

var stripPrefix = function stripPrefix(dictEq) {
  return function (v) {
    return function (s) {
      var go = function go(prefix) {
        return function (input) {
          var v1 = Data_List_Lazy_Types.step(prefix);

          if (v1 instanceof Data_List_Lazy_Types.Nil) {
            return Data_Maybe.Just.create(new Control_Monad_Rec_Class.Done(input));
          }

          ;

          if (v1 instanceof Data_List_Lazy_Types.Cons) {
            var v2 = Data_List_Lazy_Types.step(input);

            if (v2 instanceof Data_List_Lazy_Types.Cons && Data_Eq.eq(dictEq)(v1.value0)(v2.value0)) {
              return Data_Maybe.Just.create(new Control_Monad_Rec_Class.Loop({
                a: v1.value1,
                b: v2.value1
              }));
            }

            ;
            return Data_Maybe.Nothing.value;
          }

          ;
          throw new Error("Failed pattern match at Data.List.Lazy (line 499, column 21 - line 503, column 19): " + [v1.constructor.name]);
        };
      };

      return Control_Monad_Rec_Class.tailRecM2(Control_Monad_Rec_Class.monadRecMaybe)(go)(v)(s);
    };
  };
};

var span = function span(p) {
  return function (xs) {
    var v = uncons(xs);

    if (v instanceof Data_Maybe.Just && p(v.value0.head)) {
      var v1 = span(p)(v.value0.tail);
      return {
        init: Data_List_Lazy_Types.cons(v.value0.head)(v1.init),
        rest: v1.rest
      };
    }

    ;
    return {
      init: Data_List_Lazy_Types.nil,
      rest: xs
    };
  };
};

var snoc = function snoc(xs) {
  return function (x) {
    return Data_Foldable.foldr(Data_List_Lazy_Types.foldableList)(Data_List_Lazy_Types.cons)(Data_List_Lazy_Types.cons(x)(Data_List_Lazy_Types.nil))(xs);
  };
};

var singleton = function singleton(a) {
  return Data_List_Lazy_Types.cons(a)(Data_List_Lazy_Types.nil);
};

var showPattern = function showPattern(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Pattern " + (Data_Show.show(Data_List_Lazy_Types.showList(dictShow))(v) + ")");
  });
};

var scanrLazy = function scanrLazy(f) {
  return function (acc) {
    return function (xs) {
      var go = function go(v) {
        if (v instanceof Data_List_Lazy_Types.Nil) {
          return Data_List_Lazy_Types.Nil.value;
        }

        ;

        if (v instanceof Data_List_Lazy_Types.Cons) {
          var acc$prime = f(v.value0)(acc);
          return Data_List_Lazy_Types.Cons.create(acc$prime)(scanrLazy(f)(acc$prime)(v.value1));
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 764, column 5 - line 764, column 27): " + [v.constructor.name]);
      };

      return Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs));
    };
  };
};

var reverse = function reverse(xs) {
  return Control_Lazy.defer(Data_List_Lazy_Types.lazyList)(function (v) {
    return Data_Foldable.foldl(Data_List_Lazy_Types.foldableList)(Data_Function.flip(Data_List_Lazy_Types.cons))(Data_List_Lazy_Types.nil)(xs);
  });
};

var replicateM = function replicateM(dictMonad) {
  return function (n) {
    return function (m) {
      if (n < 1) {
        return Control_Applicative.pure(dictMonad.Applicative0())(Data_List_Lazy_Types.nil);
      }

      ;

      if (Data_Boolean.otherwise) {
        return Control_Bind.bind(dictMonad.Bind1())(m)(function (a) {
          return Control_Bind.bind(dictMonad.Bind1())(replicateM(dictMonad)(n - 1 | 0)(m))(function (as) {
            return Control_Applicative.pure(dictMonad.Applicative0())(Data_List_Lazy_Types.cons(a)(as));
          });
        });
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy (line 161, column 1 - line 161, column 62): " + [n.constructor.name, m.constructor.name]);
    };
  };
};

var repeat = function repeat(x) {
  return Control_Lazy.fix(Data_List_Lazy_Types.lazyList)(function (xs) {
    return Data_List_Lazy_Types.cons(x)(xs);
  });
};

var replicate = function replicate(i) {
  return function (xs) {
    return take(i)(repeat(xs));
  };
};

var range = function range(start) {
  return function (end) {
    if (start > end) {
      var g = function g(x) {
        if (x >= end) {
          return new Data_Maybe.Just(new Data_Tuple.Tuple(x, x - 1 | 0));
        }

        ;

        if (Data_Boolean.otherwise) {
          return Data_Maybe.Nothing.value;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 148, column 13 - line 149, column 38): " + [x.constructor.name]);
      };

      return Data_Unfoldable.unfoldr(Data_List_Lazy_Types.unfoldableList)(g)(start);
    }

    ;

    if (Data_Boolean.otherwise) {
      var f = function f(x) {
        if (x <= end) {
          return new Data_Maybe.Just(new Data_Tuple.Tuple(x, x + 1 | 0));
        }

        ;

        if (Data_Boolean.otherwise) {
          return Data_Maybe.Nothing.value;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 153, column 5 - line 154, column 30): " + [x.constructor.name]);
      };

      return Data_Unfoldable.unfoldr(Data_List_Lazy_Types.unfoldableList)(f)(start);
    }

    ;
    throw new Error("Failed pattern match at Data.List.Lazy (line 145, column 1 - line 145, column 32): " + [start.constructor.name, end.constructor.name]);
  };
};

var partition = function partition(f) {
  var go = function go(x) {
    return function (v) {
      var $147 = f(x);

      if ($147) {
        return {
          yes: Data_List_Lazy_Types.cons(x)(v.yes),
          no: v.no
        };
      }

      ;
      return {
        yes: v.yes,
        no: Data_List_Lazy_Types.cons(x)(v.no)
      };
    };
  };

  return Data_Foldable.foldr(Data_List_Lazy_Types.foldableList)(go)({
    yes: Data_List_Lazy_Types.nil,
    no: Data_List_Lazy_Types.nil
  });
};

var $$null = function $$null($245) {
  return Data_Maybe.isNothing(uncons($245));
};

var newtypePattern = new Data_Newtype.Newtype(function (n) {
  return n;
}, Pattern);

var mapMaybe = function mapMaybe(f) {
  var go = function go($copy_v) {
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v) {
      if (v instanceof Data_List_Lazy_Types.Nil) {
        $tco_done = true;
        return Data_List_Lazy_Types.Nil.value;
      }

      ;

      if (v instanceof Data_List_Lazy_Types.Cons) {
        var v1 = f(v.value0);

        if (v1 instanceof Data_Maybe.Nothing) {
          $copy_v = Data_List_Lazy_Types.step(v.value1);
          return;
        }

        ;

        if (v1 instanceof Data_Maybe.Just) {
          $tco_done = true;
          return new Data_List_Lazy_Types.Cons(v1.value0, mapMaybe(f)(v.value1));
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 460, column 5 - line 462, column 39): " + [v1.constructor.name]);
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy (line 458, column 3 - line 458, column 15): " + [v.constructor.name]);
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  var $246 = Data_Functor.map(Data_Lazy.functorLazy)(go);
  var $247 = Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList);
  return function ($248) {
    return Data_List_Lazy_Types.List($246($247($248)));
  };
};

var some = function some(dictAlternative) {
  return function (dictLazy) {
    return function (v) {
      return Control_Apply.apply(dictAlternative.Applicative0().Apply0())(Data_Functor.map(dictAlternative.Plus1().Alt0().Functor0())(Data_List_Lazy_Types.cons)(v))(Control_Lazy.defer(dictLazy)(function (v1) {
        return many(dictAlternative)(dictLazy)(v);
      }));
    };
  };
};

var many = function many(dictAlternative) {
  return function (dictLazy) {
    return function (v) {
      return Control_Alt.alt(dictAlternative.Plus1().Alt0())(some(dictAlternative)(dictLazy)(v))(Control_Applicative.pure(dictAlternative.Applicative0())(Data_List_Lazy_Types.nil));
    };
  };
};

var length = Data_Foldable.foldl(Data_List_Lazy_Types.foldableList)(function (l) {
  return function (v) {
    return l + 1 | 0;
  };
})(0);

var last = function () {
  var go = function go($copy_v) {
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v) {
      if (v instanceof Data_List_Lazy_Types.Cons) {
        if ($$null(v.value1)) {
          $tco_done = true;
          return new Data_Maybe.Just(v.value0);
        }

        ;

        if (Data_Boolean.otherwise) {
          $copy_v = Data_List_Lazy_Types.step(v.value1);
          return;
        }

        ;
      }

      ;
      $tco_done = true;
      return Data_Maybe.Nothing.value;
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  return function ($249) {
    return go(Data_List_Lazy_Types.step($249));
  };
}();

var iterate = function iterate(f) {
  return function (x) {
    return Control_Lazy.fix(Data_List_Lazy_Types.lazyList)(function (xs) {
      return Data_List_Lazy_Types.cons(x)(Data_Functor.map(Data_List_Lazy_Types.functorList)(f)(xs));
    });
  };
};

var insertAt = function insertAt(v) {
  return function (x) {
    return function (xs) {
      if (v === 0) {
        return Data_List_Lazy_Types.cons(x)(xs);
      }

      ;

      var go = function go(v1) {
        if (v1 instanceof Data_List_Lazy_Types.Nil) {
          return new Data_List_Lazy_Types.Cons(x, Data_List_Lazy_Types.nil);
        }

        ;

        if (v1 instanceof Data_List_Lazy_Types.Cons) {
          return new Data_List_Lazy_Types.Cons(v1.value0, insertAt(v - 1 | 0)(x)(v1.value1));
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 340, column 3 - line 340, column 22): " + [v1.constructor.name]);
      };

      return Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs));
    };
  };
};

var init = function () {
  var go = function go(v) {
    if (v instanceof Data_List_Lazy_Types.Cons) {
      if ($$null(v.value1)) {
        return new Data_Maybe.Just(Data_List_Lazy_Types.nil);
      }

      ;

      if (Data_Boolean.otherwise) {
        return Data_Functor.map(Data_Maybe.functorMaybe)(Data_List_Lazy_Types.cons(v.value0))(go(Data_List_Lazy_Types.step(v.value1)));
      }

      ;
    }

    ;
    return Data_Maybe.Nothing.value;
  };

  return function ($250) {
    return go(Data_List_Lazy_Types.step($250));
  };
}();

var index = function index(xs) {
  var go = function go($copy_v) {
    return function ($copy_v1) {
      var $tco_var_v = $copy_v;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v, v1) {
        if (v instanceof Data_List_Lazy_Types.Nil) {
          $tco_done = true;
          return Data_Maybe.Nothing.value;
        }

        ;

        if (v instanceof Data_List_Lazy_Types.Cons && v1 === 0) {
          $tco_done = true;
          return new Data_Maybe.Just(v.value0);
        }

        ;

        if (v instanceof Data_List_Lazy_Types.Cons) {
          $tco_var_v = Data_List_Lazy_Types.step(v.value1);
          $copy_v1 = v1 - 1 | 0;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 299, column 3 - line 299, column 21): " + [v.constructor.name, v1.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_v, $copy_v1);
      }

      ;
      return $tco_result;
    };
  };

  return go(Data_List_Lazy_Types.step(xs));
};

var head = function head(xs) {
  return Data_Functor.map(Data_Maybe.functorMaybe)(function (v) {
    return v.head;
  })(uncons(xs));
};

var transpose = function transpose(xs) {
  var v = uncons(xs);

  if (v instanceof Data_Maybe.Nothing) {
    return xs;
  }

  ;

  if (v instanceof Data_Maybe.Just) {
    var v1 = uncons(v.value0.head);

    if (v1 instanceof Data_Maybe.Nothing) {
      return transpose(v.value0.tail);
    }

    ;

    if (v1 instanceof Data_Maybe.Just) {
      return Data_List_Lazy_Types.cons(Data_List_Lazy_Types.cons(v1.value0.head)(mapMaybe(head)(v.value0.tail)))(transpose(Data_List_Lazy_Types.cons(v1.value0.tail)(mapMaybe(tail)(v.value0.tail))));
    }

    ;
    throw new Error("Failed pattern match at Data.List.Lazy (line 734, column 7 - line 738, column 72): " + [v1.constructor.name]);
  }

  ;
  throw new Error("Failed pattern match at Data.List.Lazy (line 730, column 3 - line 738, column 72): " + [v.constructor.name]);
};

var groupBy = function groupBy(eq) {
  var go = function go(v) {
    if (v instanceof Data_List_Lazy_Types.Nil) {
      return Data_List_Lazy_Types.Nil.value;
    }

    ;

    if (v instanceof Data_List_Lazy_Types.Cons) {
      var v1 = span(eq(v.value0))(v.value1);
      return new Data_List_Lazy_Types.Cons(Data_Lazy.defer(function (v2) {
        return new Data_NonEmpty.NonEmpty(v.value0, v1.init);
      }), groupBy(eq)(v1.rest));
    }

    ;
    throw new Error("Failed pattern match at Data.List.Lazy (line 588, column 3 - line 588, column 15): " + [v.constructor.name]);
  };

  var $251 = Data_Functor.map(Data_Lazy.functorLazy)(go);
  var $252 = Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList);
  return function ($253) {
    return Data_List_Lazy_Types.List($251($252($253)));
  };
};

var group = function group(dictEq) {
  return groupBy(Data_Eq.eq(dictEq));
};

var fromStep = function () {
  var $254 = Control_Applicative.pure(Data_Lazy.applicativeLazy);
  return function ($255) {
    return Data_List_Lazy_Types.List($254($255));
  };
}();

var insertBy = function insertBy(cmp) {
  return function (x) {
    return function (xs) {
      var go = function go(v) {
        if (v instanceof Data_List_Lazy_Types.Nil) {
          return new Data_List_Lazy_Types.Cons(x, Data_List_Lazy_Types.nil);
        }

        ;

        if (v instanceof Data_List_Lazy_Types.Cons) {
          var v1 = cmp(x)(v.value0);

          if (v1 instanceof Data_Ordering.GT) {
            return new Data_List_Lazy_Types.Cons(v.value0, insertBy(cmp)(x)(v.value1));
          }

          ;
          return new Data_List_Lazy_Types.Cons(x, fromStep(v));
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 235, column 3 - line 235, column 22): " + [v.constructor.name]);
      };

      return Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs));
    };
  };
};

var insert = function insert(dictOrd) {
  return insertBy(Data_Ord.compare(dictOrd));
};

var fromFoldable = function fromFoldable(dictFoldable) {
  return Data_Foldable.foldr(dictFoldable)(Data_List_Lazy_Types.cons)(Data_List_Lazy_Types.nil);
};

var foldrLazy = function foldrLazy(dictLazy) {
  return function (op) {
    return function (z) {
      var go = function go(xs) {
        var v = Data_List_Lazy_Types.step(xs);

        if (v instanceof Data_List_Lazy_Types.Cons) {
          return Control_Lazy.defer(dictLazy)(function (v1) {
            return op(v.value0)(go(v.value1));
          });
        }

        ;

        if (v instanceof Data_List_Lazy_Types.Nil) {
          return z;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 756, column 13 - line 758, column 15): " + [v.constructor.name]);
      };

      return go;
    };
  };
};

var foldM = function foldM(dictMonad) {
  return function (f) {
    return function (a) {
      return function (xs) {
        var v = uncons(xs);

        if (v instanceof Data_Maybe.Nothing) {
          return Control_Applicative.pure(dictMonad.Applicative0())(a);
        }

        ;

        if (v instanceof Data_Maybe.Just) {
          return Control_Bind.bind(dictMonad.Bind1())(f(a)(v.value0.head))(function (a$prime) {
            return foldM(dictMonad)(f)(a$prime)(v.value0.tail);
          });
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 747, column 5 - line 750, column 54): " + [v.constructor.name]);
      };
    };
  };
};

var findIndex = function findIndex(fn) {
  var go = function go(n) {
    return function (list) {
      return Control_Bind.bind(Data_Maybe.bindMaybe)(uncons(list))(function (o) {
        var $199 = fn(o.head);

        if ($199) {
          return Control_Applicative.pure(Data_Maybe.applicativeMaybe)(n);
        }

        ;
        return go(n + 1 | 0)(o.tail);
      });
    };
  };

  return go(0);
};

var findLastIndex = function findLastIndex(fn) {
  return function (xs) {
    return Data_Functor.map(Data_Maybe.functorMaybe)(function (v) {
      return (length(xs) - 1 | 0) - v | 0;
    })(findIndex(fn)(reverse(xs)));
  };
};

var filterM = function filterM(dictMonad) {
  return function (p) {
    return function (list) {
      var v = uncons(list);

      if (v instanceof Data_Maybe.Nothing) {
        return Control_Applicative.pure(dictMonad.Applicative0())(Data_List_Lazy_Types.nil);
      }

      ;

      if (v instanceof Data_Maybe.Just) {
        return Control_Bind.bind(dictMonad.Bind1())(p(v.value0.head))(function (b) {
          return Control_Bind.bind(dictMonad.Bind1())(filterM(dictMonad)(p)(v.value0.tail))(function (xs$prime) {
            return Control_Applicative.pure(dictMonad.Applicative0())(function () {
              if (b) {
                return Data_List_Lazy_Types.cons(v.value0.head)(xs$prime);
              }

              ;
              return xs$prime;
            }());
          });
        });
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy (line 443, column 5 - line 448, column 48): " + [v.constructor.name]);
    };
  };
};

var filter = function filter(p) {
  var go = function go($copy_v) {
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v) {
      if (v instanceof Data_List_Lazy_Types.Nil) {
        $tco_done = true;
        return Data_List_Lazy_Types.Nil.value;
      }

      ;

      if (v instanceof Data_List_Lazy_Types.Cons) {
        if (p(v.value0)) {
          $tco_done = true;
          return new Data_List_Lazy_Types.Cons(v.value0, filter(p)(v.value1));
        }

        ;

        if (Data_Boolean.otherwise) {
          $copy_v = Data_List_Lazy_Types.step(v.value1);
          return;
        }

        ;
      }

      ;
      throw new Error("Failed pattern match at Data.List.Lazy (line 428, column 3 - line 428, column 15): " + [v.constructor.name]);
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  var $256 = Data_Functor.map(Data_Lazy.functorLazy)(go);
  var $257 = Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList);
  return function ($258) {
    return Data_List_Lazy_Types.List($256($257($258)));
  };
};

var intersectBy = function intersectBy(eq) {
  return function (xs) {
    return function (ys) {
      return filter(function (x) {
        return Data_Foldable.any(Data_List_Lazy_Types.foldableList)(Data_HeytingAlgebra.heytingAlgebraBoolean)(eq(x))(ys);
      })(xs);
    };
  };
};

var intersect = function intersect(dictEq) {
  return intersectBy(Data_Eq.eq(dictEq));
};

var nubBy = function nubBy(eq) {
  var go = function go(v) {
    if (v instanceof Data_List_Lazy_Types.Nil) {
      return Data_List_Lazy_Types.Nil.value;
    }

    ;

    if (v instanceof Data_List_Lazy_Types.Cons) {
      return new Data_List_Lazy_Types.Cons(v.value0, nubBy(eq)(filter(function (y) {
        return !eq(v.value0)(y);
      })(v.value1)));
    }

    ;
    throw new Error("Failed pattern match at Data.List.Lazy (line 621, column 3 - line 621, column 15): " + [v.constructor.name]);
  };

  var $259 = Data_Functor.map(Data_Lazy.functorLazy)(go);
  var $260 = Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList);
  return function ($261) {
    return Data_List_Lazy_Types.List($259($260($261)));
  };
};

var nub = function nub(dictEq) {
  return nubBy(Data_Eq.eq(dictEq));
};

var eqPattern = function eqPattern(dictEq) {
  return new Data_Eq.Eq(function (x) {
    return function (y) {
      return Data_Eq.eq(Data_List_Lazy_Types.eqList(dictEq))(x)(y);
    };
  });
};

var ordPattern = function ordPattern(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqPattern(dictOrd.Eq0());
  }, function (x) {
    return function (y) {
      return Data_Ord.compare(Data_List_Lazy_Types.ordList(dictOrd))(x)(y);
    };
  });
};

var elemLastIndex = function elemLastIndex(dictEq) {
  return function (x) {
    return findLastIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var elemIndex = function elemIndex(dictEq) {
  return function (x) {
    return findIndex(function (v) {
      return Data_Eq.eq(dictEq)(v)(x);
    });
  };
};

var dropWhile = function dropWhile(p) {
  var go = function go($copy_v) {
    var $tco_done = false;
    var $tco_result;

    function $tco_loop(v) {
      if (v instanceof Data_List_Lazy_Types.Cons && p(v.value0)) {
        $copy_v = Data_List_Lazy_Types.step(v.value1);
        return;
      }

      ;
      $tco_done = true;
      return fromStep(v);
    }

    ;

    while (!$tco_done) {
      $tco_result = $tco_loop($copy_v);
    }

    ;
    return $tco_result;
  };

  return function ($262) {
    return go(Data_List_Lazy_Types.step($262));
  };
};

var drop = function drop(n) {
  var go = function go($copy_v) {
    return function ($copy_v1) {
      var $tco_var_v = $copy_v;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v, v1) {
        if (v === 0) {
          $tco_done = true;
          return v1;
        }

        ;

        if (v1 instanceof Data_List_Lazy_Types.Nil) {
          $tco_done = true;
          return Data_List_Lazy_Types.Nil.value;
        }

        ;

        if (v1 instanceof Data_List_Lazy_Types.Cons) {
          $tco_var_v = v - 1 | 0;
          $copy_v1 = Data_List_Lazy_Types.step(v1.value1);
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 536, column 3 - line 536, column 15): " + [v.constructor.name, v1.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_v, $copy_v1);
      }

      ;
      return $tco_result;
    };
  };

  var $263 = Data_Functor.map(Data_Lazy.functorLazy)(go(n));
  var $264 = Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList);
  return function ($265) {
    return Data_List_Lazy_Types.List($263($264($265)));
  };
};

var slice = function slice(start) {
  return function (end) {
    return function (xs) {
      return take(end - start | 0)(drop(start)(xs));
    };
  };
};

var deleteBy = function deleteBy(eq) {
  return function (x) {
    return function (xs) {
      var go = function go(v) {
        if (v instanceof Data_List_Lazy_Types.Nil) {
          return Data_List_Lazy_Types.Nil.value;
        }

        ;

        if (v instanceof Data_List_Lazy_Types.Cons) {
          if (eq(x)(v.value0)) {
            return Data_List_Lazy_Types.step(v.value1);
          }

          ;

          if (Data_Boolean.otherwise) {
            return new Data_List_Lazy_Types.Cons(v.value0, deleteBy(eq)(x)(v.value1));
          }

          ;
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 650, column 3 - line 650, column 15): " + [v.constructor.name]);
      };

      return Data_Functor.map(Data_Lazy.functorLazy)(go)(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs));
    };
  };
};

var unionBy = function unionBy(eq) {
  return function (xs) {
    return function (ys) {
      return Data_Semigroup.append(Data_List_Lazy_Types.semigroupList)(xs)(Data_Foldable.foldl(Data_List_Lazy_Types.foldableList)(Data_Function.flip(deleteBy(eq)))(nubBy(eq)(ys))(xs));
    };
  };
};

var union = function union(dictEq) {
  return unionBy(Data_Eq.eq(dictEq));
};

var deleteAt = function deleteAt(n) {
  return function (xs) {
    var go = function go(v) {
      return function (v1) {
        if (v1 instanceof Data_List_Lazy_Types.Nil) {
          return Data_List_Lazy_Types.Nil.value;
        }

        ;

        if (v === 0 && v1 instanceof Data_List_Lazy_Types.Cons) {
          return Data_List_Lazy_Types.step(v1.value1);
        }

        ;

        if (v1 instanceof Data_List_Lazy_Types.Cons) {
          return new Data_List_Lazy_Types.Cons(v1.value0, deleteAt(v - 1 | 0)(v1.value1));
        }

        ;
        throw new Error("Failed pattern match at Data.List.Lazy (line 353, column 3 - line 353, column 17): " + [v.constructor.name, v1.constructor.name]);
      };
    };

    return Data_Functor.map(Data_Lazy.functorLazy)(go(n))(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs));
  };
};

var $$delete = function $$delete(dictEq) {
  return deleteBy(Data_Eq.eq(dictEq));
};

var difference = function difference(dictEq) {
  return Data_Foldable.foldl(Data_List_Lazy_Types.foldableList)(Data_Function.flip($$delete(dictEq)));
};

var cycle = function cycle(xs) {
  return Control_Lazy.fix(Data_List_Lazy_Types.lazyList)(function (ys) {
    return Data_Semigroup.append(Data_List_Lazy_Types.semigroupList)(xs)(ys);
  });
};

var concatMap = Data_Function.flip(Control_Bind.bind(Data_List_Lazy_Types.bindList));

var concat = function concat(v) {
  return Control_Bind.bind(Data_List_Lazy_Types.bindList)(v)(Control_Category.identity(Control_Category.categoryFn));
};

var catMaybes = mapMaybe(Control_Category.identity(Control_Category.categoryFn));

var alterAt = function alterAt(n) {
  return function (f) {
    return function (xs) {
      var go = function go(v) {
        return function (v1) {
          if (v1 instanceof Data_List_Lazy_Types.Nil) {
            return Data_List_Lazy_Types.Nil.value;
          }

          ;

          if (v === 0 && v1 instanceof Data_List_Lazy_Types.Cons) {
            var v2 = f(v1.value0);

            if (v2 instanceof Data_Maybe.Nothing) {
              return Data_List_Lazy_Types.step(v1.value1);
            }

            ;

            if (v2 instanceof Data_Maybe.Just) {
              return new Data_List_Lazy_Types.Cons(v2.value0, v1.value1);
            }

            ;
            throw new Error("Failed pattern match at Data.List.Lazy (line 394, column 22 - line 396, column 26): " + [v2.constructor.name]);
          }

          ;

          if (v1 instanceof Data_List_Lazy_Types.Cons) {
            return new Data_List_Lazy_Types.Cons(v1.value0, alterAt(v - 1 | 0)(f)(v1.value1));
          }

          ;
          throw new Error("Failed pattern match at Data.List.Lazy (line 393, column 3 - line 393, column 17): " + [v.constructor.name, v1.constructor.name]);
        };
      };

      return Data_Functor.map(Data_Lazy.functorLazy)(go(n))(Data_Newtype.unwrap(Data_List_Lazy_Types.newtypeList)(xs));
    };
  };
};

var modifyAt = function modifyAt(n) {
  return function (f) {
    return alterAt(n)(function ($266) {
      return Data_Maybe.Just.create(f($266));
    });
  };
};

module.exports = {
  toUnfoldable: toUnfoldable,
  fromFoldable: fromFoldable,
  singleton: singleton,
  range: range,
  replicate: replicate,
  replicateM: replicateM,
  some: some,
  many: many,
  repeat: repeat,
  iterate: iterate,
  cycle: cycle,
  "null": $$null,
  length: length,
  snoc: snoc,
  insert: insert,
  insertBy: insertBy,
  head: head,
  last: last,
  tail: tail,
  init: init,
  uncons: uncons,
  index: index,
  elemIndex: elemIndex,
  elemLastIndex: elemLastIndex,
  findIndex: findIndex,
  findLastIndex: findLastIndex,
  insertAt: insertAt,
  deleteAt: deleteAt,
  updateAt: updateAt,
  modifyAt: modifyAt,
  alterAt: alterAt,
  reverse: reverse,
  concat: concat,
  concatMap: concatMap,
  filter: filter,
  filterM: filterM,
  mapMaybe: mapMaybe,
  catMaybes: catMaybes,
  Pattern: Pattern,
  stripPrefix: stripPrefix,
  slice: slice,
  take: take,
  takeWhile: takeWhile,
  drop: drop,
  dropWhile: dropWhile,
  span: span,
  group: group,
  groupBy: groupBy,
  partition: partition,
  nub: nub,
  nubBy: nubBy,
  union: union,
  unionBy: unionBy,
  "delete": $$delete,
  deleteBy: deleteBy,
  difference: difference,
  intersect: intersect,
  intersectBy: intersectBy,
  zipWith: zipWith,
  zipWithA: zipWithA,
  zip: zip,
  unzip: unzip,
  transpose: transpose,
  foldM: foldM,
  foldrLazy: foldrLazy,
  scanrLazy: scanrLazy,
  eqPattern: eqPattern,
  ordPattern: ordPattern,
  newtypePattern: newtypePattern,
  showPattern: showPattern
};
},{"../Control.Alt/index.js":"../output/Control.Alt/index.js","../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Lazy/index.js":"../output/Control.Lazy/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Lazy/index.js":"../output/Data.Lazy/index.js","../Data.List.Lazy.Types/index.js":"../output/Data.List.Lazy.Types/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.NonEmpty/index.js":"../output/Data.NonEmpty/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js"}],"../output/Data.Map.Internal/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_List = require("../Data.List/index.js");

var Data_List_Lazy = require("../Data.List.Lazy/index.js");

var Data_List_Lazy_Types = require("../Data.List.Lazy.Types/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Data_Unfoldable = require("../Data.Unfoldable/index.js");

var Leaf = function () {
  function Leaf() {}

  ;
  Leaf.value = new Leaf();
  return Leaf;
}();

var Two = function () {
  function Two(value0, value1, value2, value3) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
    this.value3 = value3;
  }

  ;

  Two.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return function (value3) {
          return new Two(value0, value1, value2, value3);
        };
      };
    };
  };

  return Two;
}();

var Three = function () {
  function Three(value0, value1, value2, value3, value4, value5, value6) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
    this.value3 = value3;
    this.value4 = value4;
    this.value5 = value5;
    this.value6 = value6;
  }

  ;

  Three.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return function (value3) {
          return function (value4) {
            return function (value5) {
              return function (value6) {
                return new Three(value0, value1, value2, value3, value4, value5, value6);
              };
            };
          };
        };
      };
    };
  };

  return Three;
}();

var TwoLeft = function () {
  function TwoLeft(value0, value1, value2) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
  }

  ;

  TwoLeft.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return new TwoLeft(value0, value1, value2);
      };
    };
  };

  return TwoLeft;
}();

var TwoRight = function () {
  function TwoRight(value0, value1, value2) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
  }

  ;

  TwoRight.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return new TwoRight(value0, value1, value2);
      };
    };
  };

  return TwoRight;
}();

var ThreeLeft = function () {
  function ThreeLeft(value0, value1, value2, value3, value4, value5) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
    this.value3 = value3;
    this.value4 = value4;
    this.value5 = value5;
  }

  ;

  ThreeLeft.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return function (value3) {
          return function (value4) {
            return function (value5) {
              return new ThreeLeft(value0, value1, value2, value3, value4, value5);
            };
          };
        };
      };
    };
  };

  return ThreeLeft;
}();

var ThreeMiddle = function () {
  function ThreeMiddle(value0, value1, value2, value3, value4, value5) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
    this.value3 = value3;
    this.value4 = value4;
    this.value5 = value5;
  }

  ;

  ThreeMiddle.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return function (value3) {
          return function (value4) {
            return function (value5) {
              return new ThreeMiddle(value0, value1, value2, value3, value4, value5);
            };
          };
        };
      };
    };
  };

  return ThreeMiddle;
}();

var ThreeRight = function () {
  function ThreeRight(value0, value1, value2, value3, value4, value5) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
    this.value3 = value3;
    this.value4 = value4;
    this.value5 = value5;
  }

  ;

  ThreeRight.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return function (value3) {
          return function (value4) {
            return function (value5) {
              return new ThreeRight(value0, value1, value2, value3, value4, value5);
            };
          };
        };
      };
    };
  };

  return ThreeRight;
}();

var KickUp = function () {
  function KickUp(value0, value1, value2, value3) {
    this.value0 = value0;
    this.value1 = value1;
    this.value2 = value2;
    this.value3 = value3;
  }

  ;

  KickUp.create = function (value0) {
    return function (value1) {
      return function (value2) {
        return function (value3) {
          return new KickUp(value0, value1, value2, value3);
        };
      };
    };
  };

  return KickUp;
}();

var values = function values(v) {
  if (v instanceof Leaf) {
    return Data_List_Types.Nil.value;
  }

  ;

  if (v instanceof Two) {
    return Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value2))(values(v.value3)));
  }

  ;

  if (v instanceof Three) {
    return Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value2))(Data_Semigroup.append(Data_List_Types.semigroupList)(values(v.value3))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value5))(values(v.value6)))));
  }

  ;
  throw new Error("Failed pattern match at Data.Map.Internal (line 612, column 1 - line 612, column 40): " + [v.constructor.name]);
};

var size = function size(v) {
  if (v instanceof Leaf) {
    return 0;
  }

  ;

  if (v instanceof Two) {
    return (1 + size(v.value0) | 0) + size(v.value3) | 0;
  }

  ;

  if (v instanceof Three) {
    return ((2 + size(v.value0) | 0) + size(v.value3) | 0) + size(v.value6) | 0;
  }

  ;
  throw new Error("Failed pattern match at Data.Map.Internal (line 662, column 1 - line 662, column 35): " + [v.constructor.name]);
};

var singleton = function singleton(k) {
  return function (v) {
    return new Two(Leaf.value, k, v, Leaf.value);
  };
};

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  return function (m) {
    var go = function go($copy_v) {
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v) {
        if (v instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return Data_Maybe.Nothing.value;
        }

        ;

        if (v instanceof Data_List_Types.Cons) {
          if (v.value0 instanceof Leaf) {
            $copy_v = v.value1;
            return;
          }

          ;

          if (v.value0 instanceof Two && v.value0.value0 instanceof Leaf && v.value0.value3 instanceof Leaf) {
            $tco_done = true;
            return Data_Maybe.Just.create(new Data_Tuple.Tuple(new Data_Tuple.Tuple(v.value0.value1, v.value0.value2), v.value1));
          }

          ;

          if (v.value0 instanceof Two && v.value0.value0 instanceof Leaf) {
            $tco_done = true;
            return Data_Maybe.Just.create(new Data_Tuple.Tuple(new Data_Tuple.Tuple(v.value0.value1, v.value0.value2), new Data_List_Types.Cons(v.value0.value3, v.value1)));
          }

          ;

          if (v.value0 instanceof Two) {
            $copy_v = new Data_List_Types.Cons(v.value0.value0, new Data_List_Types.Cons(singleton(v.value0.value1)(v.value0.value2), new Data_List_Types.Cons(v.value0.value3, v.value1)));
            return;
          }

          ;

          if (v.value0 instanceof Three) {
            $copy_v = new Data_List_Types.Cons(v.value0.value0, new Data_List_Types.Cons(singleton(v.value0.value1)(v.value0.value2), new Data_List_Types.Cons(v.value0.value3, new Data_List_Types.Cons(singleton(v.value0.value4)(v.value0.value5), new Data_List_Types.Cons(v.value0.value6, v.value1)))));
            return;
          }

          ;
          throw new Error("Failed pattern match at Data.Map.Internal (line 577, column 18 - line 586, column 71): " + [v.value0.constructor.name]);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 576, column 3 - line 576, column 19): " + [v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($copy_v);
      }

      ;
      return $tco_result;
    };

    return Data_Unfoldable.unfoldr(dictUnfoldable)(go)(new Data_List_Types.Cons(m, Data_List_Types.Nil.value));
  };
};

var toAscArray = toUnfoldable(Data_Unfoldable.unfoldableArray);

var toUnfoldableUnordered = function toUnfoldableUnordered(dictUnfoldable) {
  return function (m) {
    var go = function go($copy_v) {
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v) {
        if (v instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return Data_Maybe.Nothing.value;
        }

        ;

        if (v instanceof Data_List_Types.Cons) {
          if (v.value0 instanceof Leaf) {
            $copy_v = v.value1;
            return;
          }

          ;

          if (v.value0 instanceof Two) {
            $tco_done = true;
            return Data_Maybe.Just.create(new Data_Tuple.Tuple(new Data_Tuple.Tuple(v.value0.value1, v.value0.value2), new Data_List_Types.Cons(v.value0.value0, new Data_List_Types.Cons(v.value0.value3, v.value1))));
          }

          ;

          if (v.value0 instanceof Three) {
            $tco_done = true;
            return Data_Maybe.Just.create(new Data_Tuple.Tuple(new Data_Tuple.Tuple(v.value0.value1, v.value0.value2), new Data_List_Types.Cons(singleton(v.value0.value4)(v.value0.value5), new Data_List_Types.Cons(v.value0.value0, new Data_List_Types.Cons(v.value0.value3, new Data_List_Types.Cons(v.value0.value6, v.value1))))));
          }

          ;
          throw new Error("Failed pattern match at Data.Map.Internal (line 598, column 18 - line 603, column 77): " + [v.value0.constructor.name]);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 597, column 3 - line 597, column 19): " + [v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($copy_v);
      }

      ;
      return $tco_result;
    };

    return Data_Unfoldable.unfoldr(dictUnfoldable)(go)(new Data_List_Types.Cons(m, Data_List_Types.Nil.value));
  };
};

var showTree = function showTree(dictShow) {
  return function (dictShow1) {
    return function (v) {
      if (v instanceof Leaf) {
        return "Leaf";
      }

      ;

      if (v instanceof Two) {
        return "Two (" + (showTree(dictShow)(dictShow1)(v.value0) + (") (" + (Data_Show.show(dictShow)(v.value1) + (") (" + (Data_Show.show(dictShow1)(v.value2) + (") (" + (showTree(dictShow)(dictShow1)(v.value3) + ")")))))));
      }

      ;

      if (v instanceof Three) {
        return "Three (" + (showTree(dictShow)(dictShow1)(v.value0) + (") (" + (Data_Show.show(dictShow)(v.value1) + (") (" + (Data_Show.show(dictShow1)(v.value2) + (") (" + (showTree(dictShow)(dictShow1)(v.value3) + (") (" + (Data_Show.show(dictShow)(v.value4) + (") (" + (Data_Show.show(dictShow1)(v.value5) + (") (" + (showTree(dictShow)(dictShow1)(v.value6) + ")")))))))))))));
      }

      ;
      throw new Error("Failed pattern match at Data.Map.Internal (line 153, column 1 - line 153, column 62): " + [v.constructor.name]);
    };
  };
};

var showMap = function showMap(dictShow) {
  return function (dictShow1) {
    return new Data_Show.Show(function (m) {
      return "(fromFoldable " + (Data_Show.show(Data_Show.showArray(Data_Tuple.showTuple(dictShow)(dictShow1)))(toAscArray(m)) + ")");
    });
  };
};

var lookupLE = function lookupLE(dictOrd) {
  return function (k) {
    var comp = Data_Ord.compare(dictOrd);

    var go = function go(v) {
      if (v instanceof Leaf) {
        return Data_Maybe.Nothing.value;
      }

      ;

      if (v instanceof Two) {
        var v2 = comp(k)(v.value1);

        if (v2 instanceof Data_Ordering.EQ) {
          return new Data_Maybe.Just({
            key: v.value1,
            value: v.value2
          });
        }

        ;

        if (v2 instanceof Data_Ordering.GT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value1,
            value: v.value2
          })(go(v.value3)));
        }

        ;

        if (v2 instanceof Data_Ordering.LT) {
          return go(v.value0);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 225, column 33 - line 228, column 20): " + [v2.constructor.name]);
      }

      ;

      if (v instanceof Three) {
        var v3 = comp(k)(v.value4);

        if (v3 instanceof Data_Ordering.EQ) {
          return new Data_Maybe.Just({
            key: v.value4,
            value: v.value5
          });
        }

        ;

        if (v3 instanceof Data_Ordering.GT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value4,
            value: v.value5
          })(go(v.value6)));
        }

        ;

        if (v3 instanceof Data_Ordering.LT) {
          return go(new Two(v.value0, v.value1, v.value2, v.value3));
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 229, column 45 - line 232, column 36): " + [v3.constructor.name]);
      }

      ;
      throw new Error("Failed pattern match at Data.Map.Internal (line 224, column 5 - line 224, column 22): " + [v.constructor.name]);
    };

    return go;
  };
};

var lookupGE = function lookupGE(dictOrd) {
  return function (k) {
    var comp = Data_Ord.compare(dictOrd);

    var go = function go(v) {
      if (v instanceof Leaf) {
        return Data_Maybe.Nothing.value;
      }

      ;

      if (v instanceof Two) {
        var v2 = comp(k)(v.value1);

        if (v2 instanceof Data_Ordering.EQ) {
          return new Data_Maybe.Just({
            key: v.value1,
            value: v.value2
          });
        }

        ;

        if (v2 instanceof Data_Ordering.LT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value1,
            value: v.value2
          })(go(v.value0)));
        }

        ;

        if (v2 instanceof Data_Ordering.GT) {
          return go(v.value3);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 259, column 33 - line 262, column 21): " + [v2.constructor.name]);
      }

      ;

      if (v instanceof Three) {
        var v3 = comp(k)(v.value1);

        if (v3 instanceof Data_Ordering.EQ) {
          return new Data_Maybe.Just({
            key: v.value1,
            value: v.value2
          });
        }

        ;

        if (v3 instanceof Data_Ordering.LT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value1,
            value: v.value2
          })(go(v.value0)));
        }

        ;

        if (v3 instanceof Data_Ordering.GT) {
          return go(new Two(v.value3, v.value4, v.value5, v.value6));
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 263, column 45 - line 266, column 37): " + [v3.constructor.name]);
      }

      ;
      throw new Error("Failed pattern match at Data.Map.Internal (line 258, column 5 - line 258, column 22): " + [v.constructor.name]);
    };

    return go;
  };
};

var lookup = function lookup(dictOrd) {
  return function (k) {
    var comp = Data_Ord.compare(dictOrd);

    var go = function go($copy_v) {
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v) {
        if (v instanceof Leaf) {
          $tco_done = true;
          return Data_Maybe.Nothing.value;
        }

        ;

        if (v instanceof Two) {
          var v2 = comp(k)(v.value1);

          if (v2 instanceof Data_Ordering.EQ) {
            $tco_done = true;
            return new Data_Maybe.Just(v.value2);
          }

          ;

          if (v2 instanceof Data_Ordering.LT) {
            $copy_v = v.value0;
            return;
          }

          ;
          $copy_v = v.value3;
          return;
        }

        ;

        if (v instanceof Three) {
          var v3 = comp(k)(v.value1);

          if (v3 instanceof Data_Ordering.EQ) {
            $tco_done = true;
            return new Data_Maybe.Just(v.value2);
          }

          ;
          var v4 = comp(k)(v.value4);

          if (v4 instanceof Data_Ordering.EQ) {
            $tco_done = true;
            return new Data_Maybe.Just(v.value5);
          }

          ;

          if (v3 instanceof Data_Ordering.LT) {
            $copy_v = v.value0;
            return;
          }

          ;

          if (v4 instanceof Data_Ordering.GT) {
            $copy_v = v.value6;
            return;
          }

          ;
          $copy_v = v.value3;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 200, column 5 - line 200, column 22): " + [v.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($copy_v);
      }

      ;
      return $tco_result;
    };

    return go;
  };
};

var member = function member(dictOrd) {
  return function (k) {
    return function (m) {
      return Data_Maybe.isJust(lookup(dictOrd)(k)(m));
    };
  };
};

var keys = function keys(v) {
  if (v instanceof Leaf) {
    return Data_List_Types.Nil.value;
  }

  ;

  if (v instanceof Two) {
    return Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value1))(keys(v.value3)));
  }

  ;

  if (v instanceof Three) {
    return Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value1))(Data_Semigroup.append(Data_List_Types.semigroupList)(keys(v.value3))(Data_Semigroup.append(Data_List_Types.semigroupList)(Control_Applicative.pure(Data_List_Types.applicativeList)(v.value4))(keys(v.value6)))));
  }

  ;
  throw new Error("Failed pattern match at Data.Map.Internal (line 606, column 1 - line 606, column 38): " + [v.constructor.name]);
};

var isSubmap = function isSubmap(dictOrd) {
  return function (dictEq) {
    return function (m1) {
      return function (m2) {
        var f = function f(v) {
          return Data_Eq.eq(Data_Maybe.eqMaybe(dictEq))(lookup(dictOrd)(v.value0)(m2))(new Data_Maybe.Just(v.value1));
        };

        return Data_Foldable.all(Data_List_Lazy_Types.foldableList)(Data_HeytingAlgebra.heytingAlgebraBoolean)(f)(toUnfoldable(Data_List_Lazy_Types.unfoldableList)(m1));
      };
    };
  };
};

var isEmpty = function isEmpty(v) {
  if (v instanceof Leaf) {
    return true;
  }

  ;
  return false;
};

var functorMap = new Data_Functor.Functor(function (v) {
  return function (v1) {
    if (v1 instanceof Leaf) {
      return Leaf.value;
    }

    ;

    if (v1 instanceof Two) {
      return new Two(Data_Functor.map(functorMap)(v)(v1.value0), v1.value1, v(v1.value2), Data_Functor.map(functorMap)(v)(v1.value3));
    }

    ;

    if (v1 instanceof Three) {
      return new Three(Data_Functor.map(functorMap)(v)(v1.value0), v1.value1, v(v1.value2), Data_Functor.map(functorMap)(v)(v1.value3), v1.value4, v(v1.value5), Data_Functor.map(functorMap)(v)(v1.value6));
    }

    ;
    throw new Error("Failed pattern match at Data.Map.Internal (line 96, column 1 - line 99, column 110): " + [v.constructor.name, v1.constructor.name]);
  };
});
var functorWithIndexMap = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorMap;
}, function (v) {
  return function (v1) {
    if (v1 instanceof Leaf) {
      return Leaf.value;
    }

    ;

    if (v1 instanceof Two) {
      return new Two(Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value0), v1.value1, v(v1.value1)(v1.value2), Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value3));
    }

    ;

    if (v1 instanceof Three) {
      return new Three(Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value0), v1.value1, v(v1.value1)(v1.value2), Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value3), v1.value4, v(v1.value4)(v1.value5), Data_FunctorWithIndex.mapWithIndex(functorWithIndexMap)(v)(v1.value6));
    }

    ;
    throw new Error("Failed pattern match at Data.Map.Internal (line 101, column 1 - line 104, column 152): " + [v.constructor.name, v1.constructor.name]);
  };
});

var fromZipper = function fromZipper($copy_dictOrd) {
  return function ($copy_v) {
    return function ($copy_tree) {
      var $tco_var_dictOrd = $copy_dictOrd;
      var $tco_var_v = $copy_v;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(dictOrd, v, tree) {
        if (v instanceof Data_List_Types.Nil) {
          $tco_done = true;
          return tree;
        }

        ;

        if (v instanceof Data_List_Types.Cons) {
          if (v.value0 instanceof TwoLeft) {
            $tco_var_dictOrd = dictOrd;
            $tco_var_v = v.value1;
            $copy_tree = new Two(tree, v.value0.value0, v.value0.value1, v.value0.value2);
            return;
          }

          ;

          if (v.value0 instanceof TwoRight) {
            $tco_var_dictOrd = dictOrd;
            $tco_var_v = v.value1;
            $copy_tree = new Two(v.value0.value0, v.value0.value1, v.value0.value2, tree);
            return;
          }

          ;

          if (v.value0 instanceof ThreeLeft) {
            $tco_var_dictOrd = dictOrd;
            $tco_var_v = v.value1;
            $copy_tree = new Three(tree, v.value0.value0, v.value0.value1, v.value0.value2, v.value0.value3, v.value0.value4, v.value0.value5);
            return;
          }

          ;

          if (v.value0 instanceof ThreeMiddle) {
            $tco_var_dictOrd = dictOrd;
            $tco_var_v = v.value1;
            $copy_tree = new Three(v.value0.value0, v.value0.value1, v.value0.value2, tree, v.value0.value3, v.value0.value4, v.value0.value5);
            return;
          }

          ;

          if (v.value0 instanceof ThreeRight) {
            $tco_var_dictOrd = dictOrd;
            $tco_var_v = v.value1;
            $copy_tree = new Three(v.value0.value0, v.value0.value1, v.value0.value2, v.value0.value3, v.value0.value4, v.value0.value5, tree);
            return;
          }

          ;
          throw new Error("Failed pattern match at Data.Map.Internal (line 418, column 3 - line 423, column 88): " + [v.value0.constructor.name]);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 415, column 1 - line 415, column 80): " + [v.constructor.name, tree.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_dictOrd, $tco_var_v, $copy_tree);
      }

      ;
      return $tco_result;
    };
  };
};

var insert = function insert(dictOrd) {
  return function (k) {
    return function (v) {
      var up = function up($copy_v1) {
        return function ($copy_v2) {
          var $tco_var_v1 = $copy_v1;
          var $tco_done = false;
          var $tco_result;

          function $tco_loop(v1, v2) {
            if (v1 instanceof Data_List_Types.Nil) {
              $tco_done = true;
              return new Two(v2.value0, v2.value1, v2.value2, v2.value3);
            }

            ;

            if (v1 instanceof Data_List_Types.Cons) {
              if (v1.value0 instanceof TwoLeft) {
                $tco_done = true;
                return fromZipper(dictOrd)(v1.value1)(new Three(v2.value0, v2.value1, v2.value2, v2.value3, v1.value0.value0, v1.value0.value1, v1.value0.value2));
              }

              ;

              if (v1.value0 instanceof TwoRight) {
                $tco_done = true;
                return fromZipper(dictOrd)(v1.value1)(new Three(v1.value0.value0, v1.value0.value1, v1.value0.value2, v2.value0, v2.value1, v2.value2, v2.value3));
              }

              ;

              if (v1.value0 instanceof ThreeLeft) {
                $tco_var_v1 = v1.value1;
                $copy_v2 = new KickUp(new Two(v2.value0, v2.value1, v2.value2, v2.value3), v1.value0.value0, v1.value0.value1, new Two(v1.value0.value2, v1.value0.value3, v1.value0.value4, v1.value0.value5));
                return;
              }

              ;

              if (v1.value0 instanceof ThreeMiddle) {
                $tco_var_v1 = v1.value1;
                $copy_v2 = new KickUp(new Two(v1.value0.value0, v1.value0.value1, v1.value0.value2, v2.value0), v2.value1, v2.value2, new Two(v2.value3, v1.value0.value3, v1.value0.value4, v1.value0.value5));
                return;
              }

              ;

              if (v1.value0 instanceof ThreeRight) {
                $tco_var_v1 = v1.value1;
                $copy_v2 = new KickUp(new Two(v1.value0.value0, v1.value0.value1, v1.value0.value2, v1.value0.value3), v1.value0.value4, v1.value0.value5, new Two(v2.value0, v2.value1, v2.value2, v2.value3));
                return;
              }

              ;
              throw new Error("Failed pattern match at Data.Map.Internal (line 454, column 5 - line 459, column 108): " + [v1.value0.constructor.name, v2.constructor.name]);
            }

            ;
            throw new Error("Failed pattern match at Data.Map.Internal (line 451, column 3 - line 451, column 56): " + [v1.constructor.name, v2.constructor.name]);
          }

          ;

          while (!$tco_done) {
            $tco_result = $tco_loop($tco_var_v1, $copy_v2);
          }

          ;
          return $tco_result;
        };
      };

      var comp = Data_Ord.compare(dictOrd);

      var down = function down($copy_ctx) {
        return function ($copy_v1) {
          var $tco_var_ctx = $copy_ctx;
          var $tco_done = false;
          var $tco_result;

          function $tco_loop(ctx, v1) {
            if (v1 instanceof Leaf) {
              $tco_done = true;
              return up(ctx)(new KickUp(Leaf.value, k, v, Leaf.value));
            }

            ;

            if (v1 instanceof Two) {
              var v2 = comp(k)(v1.value1);

              if (v2 instanceof Data_Ordering.EQ) {
                $tco_done = true;
                return fromZipper(dictOrd)(ctx)(new Two(v1.value0, k, v, v1.value3));
              }

              ;

              if (v2 instanceof Data_Ordering.LT) {
                $tco_var_ctx = new Data_List_Types.Cons(new TwoLeft(v1.value1, v1.value2, v1.value3), ctx);
                $copy_v1 = v1.value0;
                return;
              }

              ;
              $tco_var_ctx = new Data_List_Types.Cons(new TwoRight(v1.value0, v1.value1, v1.value2), ctx);
              $copy_v1 = v1.value3;
              return;
            }

            ;

            if (v1 instanceof Three) {
              var v3 = comp(k)(v1.value1);

              if (v3 instanceof Data_Ordering.EQ) {
                $tco_done = true;
                return fromZipper(dictOrd)(ctx)(new Three(v1.value0, k, v, v1.value3, v1.value4, v1.value5, v1.value6));
              }

              ;
              var v4 = comp(k)(v1.value4);

              if (v4 instanceof Data_Ordering.EQ) {
                $tco_done = true;
                return fromZipper(dictOrd)(ctx)(new Three(v1.value0, v1.value1, v1.value2, v1.value3, k, v, v1.value6));
              }

              ;

              if (v3 instanceof Data_Ordering.LT) {
                $tco_var_ctx = new Data_List_Types.Cons(new ThreeLeft(v1.value1, v1.value2, v1.value3, v1.value4, v1.value5, v1.value6), ctx);
                $copy_v1 = v1.value0;
                return;
              }

              ;

              if (v3 instanceof Data_Ordering.GT && v4 instanceof Data_Ordering.LT) {
                $tco_var_ctx = new Data_List_Types.Cons(new ThreeMiddle(v1.value0, v1.value1, v1.value2, v1.value4, v1.value5, v1.value6), ctx);
                $copy_v1 = v1.value3;
                return;
              }

              ;
              $tco_var_ctx = new Data_List_Types.Cons(new ThreeRight(v1.value0, v1.value1, v1.value2, v1.value3, v1.value4, v1.value5), ctx);
              $copy_v1 = v1.value6;
              return;
            }

            ;
            throw new Error("Failed pattern match at Data.Map.Internal (line 434, column 3 - line 434, column 55): " + [ctx.constructor.name, v1.constructor.name]);
          }

          ;

          while (!$tco_done) {
            $tco_result = $tco_loop($tco_var_ctx, $copy_v1);
          }

          ;
          return $tco_result;
        };
      };

      return down(Data_List_Types.Nil.value);
    };
  };
};

var pop = function pop(dictOrd) {
  return function (k) {
    var up = function up($copy_ctxs) {
      return function ($copy_tree) {
        var $tco_var_ctxs = $copy_ctxs;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(ctxs, tree) {
          if (ctxs instanceof Data_List_Types.Nil) {
            $tco_done = true;
            return tree;
          }

          ;

          if (ctxs instanceof Data_List_Types.Cons) {
            if (ctxs.value0 instanceof TwoLeft && ctxs.value0.value2 instanceof Leaf && tree instanceof Leaf) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(Leaf.value, ctxs.value0.value0, ctxs.value0.value1, Leaf.value));
            }

            ;

            if (ctxs.value0 instanceof TwoRight && ctxs.value0.value0 instanceof Leaf && tree instanceof Leaf) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value));
            }

            ;

            if (ctxs.value0 instanceof TwoLeft && ctxs.value0.value2 instanceof Two) {
              $tco_var_ctxs = ctxs.value1;
              $copy_tree = new Three(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0, ctxs.value0.value2.value1, ctxs.value0.value2.value2, ctxs.value0.value2.value3);
              return;
            }

            ;

            if (ctxs.value0 instanceof TwoRight && ctxs.value0.value0 instanceof Two) {
              $tco_var_ctxs = ctxs.value1;
              $copy_tree = new Three(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3, ctxs.value0.value1, ctxs.value0.value2, tree);
              return;
            }

            ;

            if (ctxs.value0 instanceof TwoLeft && ctxs.value0.value2 instanceof Three) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(new Two(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0), ctxs.value0.value2.value1, ctxs.value0.value2.value2, new Two(ctxs.value0.value2.value3, ctxs.value0.value2.value4, ctxs.value0.value2.value5, ctxs.value0.value2.value6)));
            }

            ;

            if (ctxs.value0 instanceof TwoRight && ctxs.value0.value0 instanceof Three) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(new Two(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3), ctxs.value0.value0.value4, ctxs.value0.value0.value5, new Two(ctxs.value0.value0.value6, ctxs.value0.value1, ctxs.value0.value2, tree)));
            }

            ;

            if (ctxs.value0 instanceof ThreeLeft && ctxs.value0.value2 instanceof Leaf && ctxs.value0.value5 instanceof Leaf && tree instanceof Leaf) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value0, ctxs.value0.value1, Leaf.value, ctxs.value0.value3, ctxs.value0.value4, Leaf.value));
            }

            ;

            if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value0 instanceof Leaf && ctxs.value0.value5 instanceof Leaf && tree instanceof Leaf) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value, ctxs.value0.value3, ctxs.value0.value4, Leaf.value));
            }

            ;

            if (ctxs.value0 instanceof ThreeRight && ctxs.value0.value0 instanceof Leaf && ctxs.value0.value3 instanceof Leaf && tree instanceof Leaf) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Three(Leaf.value, ctxs.value0.value1, ctxs.value0.value2, Leaf.value, ctxs.value0.value4, ctxs.value0.value5, Leaf.value));
            }

            ;

            if (ctxs.value0 instanceof ThreeLeft && ctxs.value0.value2 instanceof Two) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(new Three(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0, ctxs.value0.value2.value1, ctxs.value0.value2.value2, ctxs.value0.value2.value3), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
            }

            ;

            if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value0 instanceof Two) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(new Three(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3, ctxs.value0.value1, ctxs.value0.value2, tree), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
            }

            ;

            if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value5 instanceof Two) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Three(tree, ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5.value0, ctxs.value0.value5.value1, ctxs.value0.value5.value2, ctxs.value0.value5.value3)));
            }

            ;

            if (ctxs.value0 instanceof ThreeRight && ctxs.value0.value3 instanceof Two) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Two(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Three(ctxs.value0.value3.value0, ctxs.value0.value3.value1, ctxs.value0.value3.value2, ctxs.value0.value3.value3, ctxs.value0.value4, ctxs.value0.value5, tree)));
            }

            ;

            if (ctxs.value0 instanceof ThreeLeft && ctxs.value0.value2 instanceof Three) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Three(new Two(tree, ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2.value0), ctxs.value0.value2.value1, ctxs.value0.value2.value2, new Two(ctxs.value0.value2.value3, ctxs.value0.value2.value4, ctxs.value0.value2.value5, ctxs.value0.value2.value6), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
            }

            ;

            if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value0 instanceof Three) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Three(new Two(ctxs.value0.value0.value0, ctxs.value0.value0.value1, ctxs.value0.value0.value2, ctxs.value0.value0.value3), ctxs.value0.value0.value4, ctxs.value0.value0.value5, new Two(ctxs.value0.value0.value6, ctxs.value0.value1, ctxs.value0.value2, tree), ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5));
            }

            ;

            if (ctxs.value0 instanceof ThreeMiddle && ctxs.value0.value5 instanceof Three) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Three(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Two(tree, ctxs.value0.value3, ctxs.value0.value4, ctxs.value0.value5.value0), ctxs.value0.value5.value1, ctxs.value0.value5.value2, new Two(ctxs.value0.value5.value3, ctxs.value0.value5.value4, ctxs.value0.value5.value5, ctxs.value0.value5.value6)));
            }

            ;

            if (ctxs.value0 instanceof ThreeRight && ctxs.value0.value3 instanceof Three) {
              $tco_done = true;
              return fromZipper(dictOrd)(ctxs.value1)(new Three(ctxs.value0.value0, ctxs.value0.value1, ctxs.value0.value2, new Two(ctxs.value0.value3.value0, ctxs.value0.value3.value1, ctxs.value0.value3.value2, ctxs.value0.value3.value3), ctxs.value0.value3.value4, ctxs.value0.value3.value5, new Two(ctxs.value0.value3.value6, ctxs.value0.value4, ctxs.value0.value5, tree)));
            }

            ;
            throw new Error("Failed pattern match at Data.Map.Internal (line 511, column 9 - line 528, column 136): " + [ctxs.value0.constructor.name, tree.constructor.name]);
          }

          ;
          throw new Error("Failed pattern match at Data.Map.Internal (line 508, column 5 - line 528, column 136): " + [ctxs.constructor.name]);
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_ctxs, $copy_tree);
        }

        ;
        return $tco_result;
      };
    };

    var removeMaxNode = function removeMaxNode($copy_ctx) {
      return function ($copy_m) {
        var $tco_var_ctx = $copy_ctx;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(ctx, m) {
          if (m instanceof Two && m.value0 instanceof Leaf && m.value3 instanceof Leaf) {
            $tco_done = true;
            return up(ctx)(Leaf.value);
          }

          ;

          if (m instanceof Two) {
            $tco_var_ctx = new Data_List_Types.Cons(new TwoRight(m.value0, m.value1, m.value2), ctx);
            $copy_m = m.value3;
            return;
          }

          ;

          if (m instanceof Three && m.value0 instanceof Leaf && m.value3 instanceof Leaf && m.value6 instanceof Leaf) {
            $tco_done = true;
            return up(new Data_List_Types.Cons(new TwoRight(Leaf.value, m.value1, m.value2), ctx))(Leaf.value);
          }

          ;

          if (m instanceof Three) {
            $tco_var_ctx = new Data_List_Types.Cons(new ThreeRight(m.value0, m.value1, m.value2, m.value3, m.value4, m.value5), ctx);
            $copy_m = m.value6;
            return;
          }

          ;
          throw new Error("Failed pattern match at Data.Map.Internal (line 540, column 5 - line 544, column 107): " + [m.constructor.name]);
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_ctx, $copy_m);
        }

        ;
        return $tco_result;
      };
    };

    var maxNode = function maxNode($copy_m) {
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(m) {
        if (m instanceof Two && m.value3 instanceof Leaf) {
          $tco_done = true;
          return {
            key: m.value1,
            value: m.value2
          };
        }

        ;

        if (m instanceof Two) {
          $copy_m = m.value3;
          return;
        }

        ;

        if (m instanceof Three && m.value6 instanceof Leaf) {
          $tco_done = true;
          return {
            key: m.value4,
            value: m.value5
          };
        }

        ;

        if (m instanceof Three) {
          $copy_m = m.value6;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 531, column 33 - line 535, column 45): " + [m.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($copy_m);
      }

      ;
      return $tco_result;
    };

    var comp = Data_Ord.compare(dictOrd);

    var down = function down($copy_ctx) {
      return function ($copy_m) {
        var $tco_var_ctx = $copy_ctx;
        var $tco_done = false;
        var $tco_result;

        function $tco_loop(ctx, m) {
          if (m instanceof Leaf) {
            $tco_done = true;
            return Data_Maybe.Nothing.value;
          }

          ;

          if (m instanceof Two) {
            var v = comp(k)(m.value1);

            if (m.value3 instanceof Leaf && v instanceof Data_Ordering.EQ) {
              $tco_done = true;
              return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, up(ctx)(Leaf.value)));
            }

            ;

            if (v instanceof Data_Ordering.EQ) {
              var max = maxNode(m.value0);
              $tco_done = true;
              return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, removeMaxNode(new Data_List_Types.Cons(new TwoLeft(max.key, max.value, m.value3), ctx))(m.value0)));
            }

            ;

            if (v instanceof Data_Ordering.LT) {
              $tco_var_ctx = new Data_List_Types.Cons(new TwoLeft(m.value1, m.value2, m.value3), ctx);
              $copy_m = m.value0;
              return;
            }

            ;
            $tco_var_ctx = new Data_List_Types.Cons(new TwoRight(m.value0, m.value1, m.value2), ctx);
            $copy_m = m.value3;
            return;
          }

          ;

          if (m instanceof Three) {
            var leaves = function () {
              if (m.value0 instanceof Leaf && m.value3 instanceof Leaf && m.value6 instanceof Leaf) {
                return true;
              }

              ;
              return false;
            }();

            var v = comp(k)(m.value4);
            var v3 = comp(k)(m.value1);

            if (leaves && v3 instanceof Data_Ordering.EQ) {
              $tco_done = true;
              return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, fromZipper(dictOrd)(ctx)(new Two(Leaf.value, m.value4, m.value5, Leaf.value))));
            }

            ;

            if (leaves && v instanceof Data_Ordering.EQ) {
              $tco_done = true;
              return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value5, fromZipper(dictOrd)(ctx)(new Two(Leaf.value, m.value1, m.value2, Leaf.value))));
            }

            ;

            if (v3 instanceof Data_Ordering.EQ) {
              var max = maxNode(m.value0);
              $tco_done = true;
              return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value2, removeMaxNode(new Data_List_Types.Cons(new ThreeLeft(max.key, max.value, m.value3, m.value4, m.value5, m.value6), ctx))(m.value0)));
            }

            ;

            if (v instanceof Data_Ordering.EQ) {
              var max = maxNode(m.value3);
              $tco_done = true;
              return new Data_Maybe.Just(new Data_Tuple.Tuple(m.value5, removeMaxNode(new Data_List_Types.Cons(new ThreeMiddle(m.value0, m.value1, m.value2, max.key, max.value, m.value6), ctx))(m.value3)));
            }

            ;

            if (v3 instanceof Data_Ordering.LT) {
              $tco_var_ctx = new Data_List_Types.Cons(new ThreeLeft(m.value1, m.value2, m.value3, m.value4, m.value5, m.value6), ctx);
              $copy_m = m.value0;
              return;
            }

            ;

            if (v3 instanceof Data_Ordering.GT && v instanceof Data_Ordering.LT) {
              $tco_var_ctx = new Data_List_Types.Cons(new ThreeMiddle(m.value0, m.value1, m.value2, m.value4, m.value5, m.value6), ctx);
              $copy_m = m.value3;
              return;
            }

            ;
            $tco_var_ctx = new Data_List_Types.Cons(new ThreeRight(m.value0, m.value1, m.value2, m.value3, m.value4, m.value5), ctx);
            $copy_m = m.value6;
            return;
          }

          ;
          throw new Error("Failed pattern match at Data.Map.Internal (line 481, column 34 - line 504, column 80): " + [m.constructor.name]);
        }

        ;

        while (!$tco_done) {
          $tco_result = $tco_loop($tco_var_ctx, $copy_m);
        }

        ;
        return $tco_result;
      };
    };

    return down(Data_List_Types.Nil.value);
  };
};

var foldableMap = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return function (m) {
      return Data_Foldable.foldMap(Data_List_Types.foldableList)(dictMonoid)(f)(values(m));
    };
  };
}, function (f) {
  return function (z) {
    return function (m) {
      return Data_Foldable.foldl(Data_List_Types.foldableList)(f)(z)(values(m));
    };
  };
}, function (f) {
  return function (z) {
    return function (m) {
      return Data_Foldable.foldr(Data_List_Types.foldableList)(f)(z)(values(m));
    };
  };
});
var traversableMap = new Data_Traversable.Traversable(function () {
  return foldableMap;
}, function () {
  return functorMap;
}, function (dictApplicative) {
  return Data_Traversable.traverse(traversableMap)(dictApplicative)(Control_Category.identity(Control_Category.categoryFn));
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      if (v instanceof Leaf) {
        return Control_Applicative.pure(dictApplicative)(Leaf.value);
      }

      ;

      if (v instanceof Two) {
        return Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Two.create)(Data_Traversable.traverse(traversableMap)(dictApplicative)(f)(v.value0)))(Control_Applicative.pure(dictApplicative)(v.value1)))(f(v.value2)))(Data_Traversable.traverse(traversableMap)(dictApplicative)(f)(v.value3));
      }

      ;

      if (v instanceof Three) {
        return Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Three.create)(Data_Traversable.traverse(traversableMap)(dictApplicative)(f)(v.value0)))(Control_Applicative.pure(dictApplicative)(v.value1)))(f(v.value2)))(Data_Traversable.traverse(traversableMap)(dictApplicative)(f)(v.value3)))(Control_Applicative.pure(dictApplicative)(v.value4)))(f(v.value5)))(Data_Traversable.traverse(traversableMap)(dictApplicative)(f)(v.value6));
      }

      ;
      throw new Error("Failed pattern match at Data.Map.Internal (line 119, column 1 - line 134, column 31): " + [f.constructor.name, v.constructor.name]);
    };
  };
});

var foldSubmap = function foldSubmap(dictOrd) {
  return function (dictMonoid) {
    return function (kmin) {
      return function (kmax) {
        return function (f) {
          var tooSmall = function () {
            if (kmin instanceof Data_Maybe.Just) {
              return function (k) {
                return Data_Ord.lessThan(dictOrd)(k)(kmin.value0);
              };
            }

            ;

            if (kmin instanceof Data_Maybe.Nothing) {
              return Data_Function["const"](false);
            }

            ;
            throw new Error("Failed pattern match at Data.Map.Internal (line 319, column 7 - line 323, column 22): " + [kmin.constructor.name]);
          }();

          var tooLarge = function () {
            if (kmax instanceof Data_Maybe.Just) {
              return function (k) {
                return Data_Ord.greaterThan(dictOrd)(k)(kmax.value0);
              };
            }

            ;

            if (kmax instanceof Data_Maybe.Nothing) {
              return Data_Function["const"](false);
            }

            ;
            throw new Error("Failed pattern match at Data.Map.Internal (line 326, column 7 - line 330, column 22): " + [kmax.constructor.name]);
          }();

          var inBounds = function () {
            if (kmin instanceof Data_Maybe.Just && kmax instanceof Data_Maybe.Just) {
              return function (k) {
                return Data_Ord.lessThanOrEq(dictOrd)(kmin.value0)(k) && Data_Ord.lessThanOrEq(dictOrd)(k)(kmax.value0);
              };
            }

            ;

            if (kmin instanceof Data_Maybe.Just && kmax instanceof Data_Maybe.Nothing) {
              return function (k) {
                return Data_Ord.lessThanOrEq(dictOrd)(kmin.value0)(k);
              };
            }

            ;

            if (kmin instanceof Data_Maybe.Nothing && kmax instanceof Data_Maybe.Just) {
              return function (k) {
                return Data_Ord.lessThanOrEq(dictOrd)(k)(kmax.value0);
              };
            }

            ;

            if (kmin instanceof Data_Maybe.Nothing && kmax instanceof Data_Maybe.Nothing) {
              return Data_Function["const"](true);
            }

            ;
            throw new Error("Failed pattern match at Data.Map.Internal (line 333, column 7 - line 341, column 21): " + [kmin.constructor.name, kmax.constructor.name]);
          }();

          var go = function go(v) {
            if (v instanceof Leaf) {
              return Data_Monoid.mempty(dictMonoid);
            }

            ;

            if (v instanceof Two) {
              return Data_Semigroup.append(dictMonoid.Semigroup0())(function () {
                var $633 = tooSmall(v.value1);

                if ($633) {
                  return Data_Monoid.mempty(dictMonoid);
                }

                ;
                return go(v.value0);
              }())(Data_Semigroup.append(dictMonoid.Semigroup0())(function () {
                var $634 = inBounds(v.value1);

                if ($634) {
                  return f(v.value1)(v.value2);
                }

                ;
                return Data_Monoid.mempty(dictMonoid);
              }())(function () {
                var $635 = tooLarge(v.value1);

                if ($635) {
                  return Data_Monoid.mempty(dictMonoid);
                }

                ;
                return go(v.value3);
              }()));
            }

            ;

            if (v instanceof Three) {
              return Data_Semigroup.append(dictMonoid.Semigroup0())(function () {
                var $640 = tooSmall(v.value1);

                if ($640) {
                  return Data_Monoid.mempty(dictMonoid);
                }

                ;
                return go(v.value0);
              }())(Data_Semigroup.append(dictMonoid.Semigroup0())(function () {
                var $641 = inBounds(v.value1);

                if ($641) {
                  return f(v.value1)(v.value2);
                }

                ;
                return Data_Monoid.mempty(dictMonoid);
              }())(Data_Semigroup.append(dictMonoid.Semigroup0())(function () {
                var $642 = tooSmall(v.value4) || tooLarge(v.value1);

                if ($642) {
                  return Data_Monoid.mempty(dictMonoid);
                }

                ;
                return go(v.value3);
              }())(Data_Semigroup.append(dictMonoid.Semigroup0())(function () {
                var $643 = inBounds(v.value4);

                if ($643) {
                  return f(v.value4)(v.value5);
                }

                ;
                return Data_Monoid.mempty(dictMonoid);
              }())(function () {
                var $644 = tooLarge(v.value4);

                if ($644) {
                  return Data_Monoid.mempty(dictMonoid);
                }

                ;
                return go(v.value6);
              }()))));
            }

            ;
            throw new Error("Failed pattern match at Data.Map.Internal (line 359, column 10 - line 371, column 54): " + [v.constructor.name]);
          };

          return go;
        };
      };
    };
  };
};

var findMin = function () {
  var go = function go($copy_v) {
    return function ($copy_v1) {
      var $tco_var_v = $copy_v;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v, v1) {
        if (v1 instanceof Leaf) {
          $tco_done = true;
          return v;
        }

        ;

        if (v1 instanceof Two) {
          $tco_var_v = new Data_Maybe.Just({
            key: v1.value1,
            value: v1.value2
          });
          $copy_v1 = v1.value0;
          return;
        }

        ;

        if (v1 instanceof Three) {
          $tco_var_v = new Data_Maybe.Just({
            key: v1.value1,
            value: v1.value2
          });
          $copy_v1 = v1.value0;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 297, column 5 - line 297, column 22): " + [v.constructor.name, v1.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_v, $copy_v1);
      }

      ;
      return $tco_result;
    };
  };

  return go(Data_Maybe.Nothing.value);
}();

var lookupGT = function lookupGT(dictOrd) {
  return function (k) {
    var comp = Data_Ord.compare(dictOrd);

    var go = function go(v) {
      if (v instanceof Leaf) {
        return Data_Maybe.Nothing.value;
      }

      ;

      if (v instanceof Two) {
        var v2 = comp(k)(v.value1);

        if (v2 instanceof Data_Ordering.EQ) {
          return findMin(v.value3);
        }

        ;

        if (v2 instanceof Data_Ordering.LT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value1,
            value: v.value2
          })(go(v.value0)));
        }

        ;

        if (v2 instanceof Data_Ordering.GT) {
          return go(v.value3);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 276, column 33 - line 279, column 21): " + [v2.constructor.name]);
      }

      ;

      if (v instanceof Three) {
        var v3 = comp(k)(v.value1);

        if (v3 instanceof Data_Ordering.EQ) {
          return findMin(new Two(v.value3, v.value4, v.value5, v.value6));
        }

        ;

        if (v3 instanceof Data_Ordering.LT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value1,
            value: v.value2
          })(go(v.value0)));
        }

        ;

        if (v3 instanceof Data_Ordering.GT) {
          return go(new Two(v.value3, v.value4, v.value5, v.value6));
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 280, column 45 - line 283, column 37): " + [v3.constructor.name]);
      }

      ;
      throw new Error("Failed pattern match at Data.Map.Internal (line 275, column 5 - line 275, column 22): " + [v.constructor.name]);
    };

    return go;
  };
};

var findMax = function () {
  var go = function go($copy_v) {
    return function ($copy_v1) {
      var $tco_var_v = $copy_v;
      var $tco_done = false;
      var $tco_result;

      function $tco_loop(v, v1) {
        if (v1 instanceof Leaf) {
          $tco_done = true;
          return v;
        }

        ;

        if (v1 instanceof Two) {
          $tco_var_v = new Data_Maybe.Just({
            key: v1.value1,
            value: v1.value2
          });
          $copy_v1 = v1.value3;
          return;
        }

        ;

        if (v1 instanceof Three) {
          $tco_var_v = new Data_Maybe.Just({
            key: v1.value4,
            value: v1.value5
          });
          $copy_v1 = v1.value6;
          return;
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 289, column 5 - line 289, column 22): " + [v.constructor.name, v1.constructor.name]);
      }

      ;

      while (!$tco_done) {
        $tco_result = $tco_loop($tco_var_v, $copy_v1);
      }

      ;
      return $tco_result;
    };
  };

  return go(Data_Maybe.Nothing.value);
}();

var lookupLT = function lookupLT(dictOrd) {
  return function (k) {
    var comp = Data_Ord.compare(dictOrd);

    var go = function go(v) {
      if (v instanceof Leaf) {
        return Data_Maybe.Nothing.value;
      }

      ;

      if (v instanceof Two) {
        var v2 = comp(k)(v.value1);

        if (v2 instanceof Data_Ordering.EQ) {
          return findMax(v.value0);
        }

        ;

        if (v2 instanceof Data_Ordering.GT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value1,
            value: v.value2
          })(go(v.value3)));
        }

        ;

        if (v2 instanceof Data_Ordering.LT) {
          return go(v.value0);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 242, column 33 - line 245, column 20): " + [v2.constructor.name]);
      }

      ;

      if (v instanceof Three) {
        var v3 = comp(k)(v.value4);

        if (v3 instanceof Data_Ordering.EQ) {
          return findMax(new Two(v.value0, v.value1, v.value2, v.value3));
        }

        ;

        if (v3 instanceof Data_Ordering.GT) {
          return Data_Maybe.Just.create(Data_Maybe.fromMaybe({
            key: v.value4,
            value: v.value5
          })(go(v.value6)));
        }

        ;

        if (v3 instanceof Data_Ordering.LT) {
          return go(new Two(v.value0, v.value1, v.value2, v.value3));
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 246, column 45 - line 249, column 36): " + [v3.constructor.name]);
      }

      ;
      throw new Error("Failed pattern match at Data.Map.Internal (line 241, column 5 - line 241, column 22): " + [v.constructor.name]);
    };

    return go;
  };
};

var eqMap = function eqMap(dictEq) {
  return function (dictEq1) {
    return new Data_Eq.Eq(function (m1) {
      return function (m2) {
        return Data_Eq.eq(Data_Eq.eqArray(Data_Tuple.eqTuple(dictEq)(dictEq1)))(toAscArray(m1))(toAscArray(m2));
      };
    });
  };
};

var ordMap = function ordMap(dictOrd) {
  return function (dictOrd1) {
    return new Data_Ord.Ord(function () {
      return eqMap(dictOrd.Eq0())(dictOrd1.Eq0());
    }, function (m1) {
      return function (m2) {
        return Data_Ord.compare(Data_Ord.ordArray(Data_Tuple.ordTuple(dictOrd)(dictOrd1)))(toAscArray(m1))(toAscArray(m2));
      };
    });
  };
};

var eq1Map = function eq1Map(dictEq) {
  return new Data_Eq.Eq1(function (dictEq1) {
    return Data_Eq.eq(eqMap(dictEq)(dictEq1));
  });
};

var ord1Map = function ord1Map(dictOrd) {
  return new Data_Ord.Ord1(function () {
    return eq1Map(dictOrd.Eq0());
  }, function (dictOrd1) {
    return Data_Ord.compare(ordMap(dictOrd)(dictOrd1));
  });
};

var empty = Leaf.value;

var fromFoldable = function fromFoldable(dictOrd) {
  return function (dictFoldable) {
    return Data_Foldable.foldl(dictFoldable)(function (m) {
      return function (v) {
        return insert(dictOrd)(v.value0)(v.value1)(m);
      };
    })(empty);
  };
};

var filterWithKey = function filterWithKey(dictOrd) {
  return function (predicate) {
    var $758 = fromFoldable(dictOrd)(Data_List_Lazy_Types.foldableList);
    var $759 = Data_List_Lazy.filter(Data_Tuple.uncurry(predicate));
    var $760 = toUnfoldable(Data_List_Lazy_Types.unfoldableList);
    return function ($761) {
      return $758($759($760($761)));
    };
  };
};

var filter = function filter(dictOrd) {
  return function (predicate) {
    return filterWithKey(dictOrd)(Data_Function["const"](predicate));
  };
};

var filterKeys = function filterKeys(dictOrd) {
  return function (predicate) {
    return filterWithKey(dictOrd)(function ($762) {
      return Data_Function["const"](predicate($762));
    });
  };
};

var fromFoldableWithIndex = function fromFoldableWithIndex(dictOrd) {
  return function (dictFoldableWithIndex) {
    return Data_FoldableWithIndex.foldlWithIndex(dictFoldableWithIndex)(function (k) {
      return function (m) {
        return function (v) {
          return insert(dictOrd)(k)(v)(m);
        };
      };
    })(empty);
  };
};

var intersectionWith = function intersectionWith(dictOrd) {
  return function (f) {
    return function (m1) {
      return function (m2) {
        var go = function go($copy_v) {
          return function ($copy_v1) {
            return function ($copy_m) {
              var $tco_var_v = $copy_v;
              var $tco_var_v1 = $copy_v1;
              var $tco_done = false;
              var $tco_result;

              function $tco_loop(v, v1, m) {
                if (v instanceof Data_List_Types.Nil) {
                  $tco_done = true;
                  return m;
                }

                ;

                if (v1 instanceof Data_List_Types.Nil) {
                  $tco_done = true;
                  return m;
                }

                ;

                if (v instanceof Data_List_Types.Cons && v1 instanceof Data_List_Types.Cons) {
                  var v2 = Data_Ord.compare(dictOrd)(v.value0.value0)(v1.value0.value0);

                  if (v2 instanceof Data_Ordering.LT) {
                    $tco_var_v = v.value1;
                    $tco_var_v1 = v1;
                    $copy_m = m;
                    return;
                  }

                  ;

                  if (v2 instanceof Data_Ordering.EQ) {
                    $tco_var_v = v.value1;
                    $tco_var_v1 = v1.value1;
                    $copy_m = insert(dictOrd)(v.value0.value0)(f(v.value0.value1)(v1.value0.value1))(m);
                    return;
                  }

                  ;

                  if (v2 instanceof Data_Ordering.GT) {
                    $tco_var_v = v;
                    $tco_var_v1 = v1.value1;
                    $copy_m = m;
                    return;
                  }

                  ;
                  throw new Error("Failed pattern match at Data.Map.Internal (line 641, column 5 - line 644, column 27): " + [v2.constructor.name]);
                }

                ;
                throw new Error("Failed pattern match at Data.Map.Internal (line 638, column 3 - line 638, column 17): " + [v.constructor.name, v1.constructor.name, m.constructor.name]);
              }

              ;

              while (!$tco_done) {
                $tco_result = $tco_loop($tco_var_v, $tco_var_v1, $copy_m);
              }

              ;
              return $tco_result;
            };
          };
        };

        return go(toUnfoldable(Data_List_Types.unfoldableList)(m1))(toUnfoldable(Data_List_Types.unfoldableList)(m2))(empty);
      };
    };
  };
};

var intersection = function intersection(dictOrd) {
  return intersectionWith(dictOrd)(Data_Function["const"]);
};

var $$delete = function $$delete(dictOrd) {
  return function (k) {
    return function (m) {
      return Data_Maybe.maybe(m)(Data_Tuple.snd)(pop(dictOrd)(k)(m));
    };
  };
};

var difference = function difference(dictOrd) {
  return function (m1) {
    return function (m2) {
      return Data_Foldable.foldl(Data_List_Types.foldableList)(Data_Function.flip($$delete(dictOrd)))(m1)(keys(m2));
    };
  };
};

var checkValid = function checkValid(tree) {
  var allHeights = function allHeights(v) {
    if (v instanceof Leaf) {
      return Control_Applicative.pure(Data_List_Types.applicativeList)(0);
    }

    ;

    if (v instanceof Two) {
      return Data_Functor.map(Data_List_Types.functorList)(function (n) {
        return n + 1 | 0;
      })(Data_Semigroup.append(Data_List_Types.semigroupList)(allHeights(v.value0))(allHeights(v.value3)));
    }

    ;

    if (v instanceof Three) {
      return Data_Functor.map(Data_List_Types.functorList)(function (n) {
        return n + 1 | 0;
      })(Data_Semigroup.append(Data_List_Types.semigroupList)(allHeights(v.value0))(Data_Semigroup.append(Data_List_Types.semigroupList)(allHeights(v.value3))(allHeights(v.value6))));
    }

    ;
    throw new Error("Failed pattern match at Data.Map.Internal (line 188, column 3 - line 188, column 36): " + [v.constructor.name]);
  };

  return Data_List.length(Data_List.nub(Data_Eq.eqInt)(allHeights(tree))) === 1;
};

var asList = Control_Category.identity(Control_Category.categoryFn);
var foldableWithIndexMap = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableMap;
}, function (dictMonoid) {
  return function (f) {
    return function (m) {
      return Data_Foldable.foldMap(Data_List_Types.foldableList)(dictMonoid)(Data_Tuple.uncurry(f))(asList(toUnfoldable(Data_List_Types.unfoldableList)(m)));
    };
  };
}, function (f) {
  return function (z) {
    return function (m) {
      return Data_Foldable.foldl(Data_List_Types.foldableList)(function () {
        var $763 = Data_Function.flip(f);
        return function ($764) {
          return Data_Tuple.uncurry($763($764));
        };
      }())(z)(asList(toUnfoldable(Data_List_Types.unfoldableList)(m)));
    };
  };
}, function (f) {
  return function (z) {
    return function (m) {
      return Data_Foldable.foldr(Data_List_Types.foldableList)(Data_Tuple.uncurry(f))(z)(asList(toUnfoldable(Data_List_Types.unfoldableList)(m)));
    };
  };
});

var mapMaybeWithKey = function mapMaybeWithKey(dictOrd) {
  return function (f) {
    return Data_FoldableWithIndex.foldrWithIndex(foldableWithIndexMap)(function (k) {
      return function (a) {
        return function (acc) {
          return Data_Maybe.maybe(acc)(function (b) {
            return insert(dictOrd)(k)(b)(acc);
          })(f(k)(a));
        };
      };
    })(empty);
  };
};

var mapMaybe = function mapMaybe(dictOrd) {
  var $765 = mapMaybeWithKey(dictOrd);
  return function ($766) {
    return $765(Data_Function["const"]($766));
  };
};

var traversableWithIndexMap = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexMap;
}, function () {
  return functorWithIndexMap;
}, function () {
  return traversableMap;
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      if (v instanceof Leaf) {
        return Control_Applicative.pure(dictApplicative)(Leaf.value);
      }

      ;

      if (v instanceof Two) {
        return Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Two.create)(Data_TraversableWithIndex.traverseWithIndex(traversableWithIndexMap)(dictApplicative)(f)(v.value0)))(Control_Applicative.pure(dictApplicative)(v.value1)))(f(v.value1)(v.value2)))(Data_TraversableWithIndex.traverseWithIndex(traversableWithIndexMap)(dictApplicative)(f)(v.value3));
      }

      ;

      if (v instanceof Three) {
        return Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Control_Apply.apply(dictApplicative.Apply0())(Data_Functor.map(dictApplicative.Apply0().Functor0())(Three.create)(Data_TraversableWithIndex.traverseWithIndex(traversableWithIndexMap)(dictApplicative)(f)(v.value0)))(Control_Applicative.pure(dictApplicative)(v.value1)))(f(v.value1)(v.value2)))(Data_TraversableWithIndex.traverseWithIndex(traversableWithIndexMap)(dictApplicative)(f)(v.value3)))(Control_Applicative.pure(dictApplicative)(v.value4)))(f(v.value4)(v.value5)))(Data_TraversableWithIndex.traverseWithIndex(traversableWithIndexMap)(dictApplicative)(f)(v.value6));
      }

      ;
      throw new Error("Failed pattern match at Data.Map.Internal (line 136, column 1 - line 150, column 40): " + [f.constructor.name, v.constructor.name]);
    };
  };
});

var alter = function alter(dictOrd) {
  return function (f) {
    return function (k) {
      return function (m) {
        var v = f(lookup(dictOrd)(k)(m));

        if (v instanceof Data_Maybe.Nothing) {
          return $$delete(dictOrd)(k)(m);
        }

        ;

        if (v instanceof Data_Maybe.Just) {
          return insert(dictOrd)(k)(v.value0)(m);
        }

        ;
        throw new Error("Failed pattern match at Data.Map.Internal (line 549, column 15 - line 551, column 25): " + [v.constructor.name]);
      };
    };
  };
};

var fromFoldableWith = function fromFoldableWith(dictOrd) {
  return function (dictFoldable) {
    return function (f) {
      var combine = function combine(v) {
        return function (v1) {
          if (v1 instanceof Data_Maybe.Just) {
            return Data_Maybe.Just.create(f(v)(v1.value0));
          }

          ;

          if (v1 instanceof Data_Maybe.Nothing) {
            return new Data_Maybe.Just(v);
          }

          ;
          throw new Error("Failed pattern match at Data.Map.Internal (line 566, column 3 - line 566, column 38): " + [v.constructor.name, v1.constructor.name]);
        };
      };

      return Data_Foldable.foldl(dictFoldable)(function (m) {
        return function (v) {
          return alter(dictOrd)(combine(v.value1))(v.value0)(m);
        };
      })(empty);
    };
  };
};

var insertWith = function insertWith(dictOrd) {
  return function (f) {
    return function (k) {
      return function (v) {
        return alter(dictOrd)(function () {
          var $767 = Data_Maybe.maybe(v)(Data_Function.flip(f)(v));
          return function ($768) {
            return Data_Maybe.Just.create($767($768));
          };
        }())(k);
      };
    };
  };
};

var unionWith = function unionWith(dictOrd) {
  return function (f) {
    return function (m1) {
      return function (m2) {
        var go = function go(m) {
          return function (v) {
            return alter(dictOrd)(function () {
              var $769 = Data_Maybe.maybe(v.value1)(f(v.value1));
              return function ($770) {
                return Data_Maybe.Just.create($769($770));
              };
            }())(v.value0)(m);
          };
        };

        return Data_Foldable.foldl(Data_List_Types.foldableList)(go)(m2)(toUnfoldable(Data_List_Types.unfoldableList)(m1));
      };
    };
  };
};

var union = function union(dictOrd) {
  return unionWith(dictOrd)(Data_Function["const"]);
};

var semigroupMap = function semigroupMap(dictOrd) {
  return new Data_Semigroup.Semigroup(union(dictOrd));
};

var monoidMap = function monoidMap(dictOrd) {
  return new Data_Monoid.Monoid(function () {
    return semigroupMap(dictOrd);
  }, empty);
};

var submap = function submap(dictOrd) {
  return function (kmin) {
    return function (kmax) {
      return foldSubmap(dictOrd)(monoidMap(dictOrd))(kmin)(kmax)(singleton);
    };
  };
};

var unions = function unions(dictOrd) {
  return function (dictFoldable) {
    return Data_Foldable.foldl(dictFoldable)(union(dictOrd))(empty);
  };
};

var update = function update(dictOrd) {
  return function (f) {
    return function (k) {
      return function (m) {
        return alter(dictOrd)(Data_Maybe.maybe(Data_Maybe.Nothing.value)(f))(k)(m);
      };
    };
  };
};

module.exports = {
  showTree: showTree,
  empty: empty,
  isEmpty: isEmpty,
  singleton: singleton,
  checkValid: checkValid,
  insert: insert,
  insertWith: insertWith,
  lookup: lookup,
  lookupLE: lookupLE,
  lookupLT: lookupLT,
  lookupGE: lookupGE,
  lookupGT: lookupGT,
  findMin: findMin,
  findMax: findMax,
  foldSubmap: foldSubmap,
  submap: submap,
  fromFoldable: fromFoldable,
  fromFoldableWith: fromFoldableWith,
  fromFoldableWithIndex: fromFoldableWithIndex,
  toUnfoldable: toUnfoldable,
  toUnfoldableUnordered: toUnfoldableUnordered,
  "delete": $$delete,
  pop: pop,
  member: member,
  alter: alter,
  update: update,
  keys: keys,
  values: values,
  union: union,
  unionWith: unionWith,
  unions: unions,
  intersection: intersection,
  intersectionWith: intersectionWith,
  difference: difference,
  isSubmap: isSubmap,
  size: size,
  filterWithKey: filterWithKey,
  filterKeys: filterKeys,
  filter: filter,
  mapMaybeWithKey: mapMaybeWithKey,
  mapMaybe: mapMaybe,
  eq1Map: eq1Map,
  eqMap: eqMap,
  ord1Map: ord1Map,
  ordMap: ordMap,
  showMap: showMap,
  semigroupMap: semigroupMap,
  monoidMap: monoidMap,
  functorMap: functorMap,
  functorWithIndexMap: functorWithIndexMap,
  foldableMap: foldableMap,
  foldableWithIndexMap: foldableWithIndexMap,
  traversableMap: traversableMap,
  traversableWithIndexMap: traversableWithIndexMap
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.List/index.js":"../output/Data.List/index.js","../Data.List.Lazy/index.js":"../output/Data.List.Lazy/index.js","../Data.List.Lazy.Types/index.js":"../output/Data.List.Lazy.Types/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js","../Data.Unfoldable/index.js":"../output/Data.Unfoldable/index.js"}],"../output/Data.Set/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Control_Monad_Rec_Class = require("../Control.Monad.Rec.Class/index.js");

var Control_Monad_ST_Internal = require("../Control.Monad.ST.Internal/index.js");

var Data_Array = require("../Data.Array/index.js");

var Data_Array_ST = require("../Data.Array.ST/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_List = require("../Data.List/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Map_Internal = require("../Data.Map.Internal/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Ordering = require("../Data.Ordering/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var $$Set = function $$Set(x) {
  return x;
};

var union = function union(dictOrd) {
  return function (v) {
    return function (v1) {
      return Data_Map_Internal.union(dictOrd)(v)(v1);
    };
  };
};

var toList = function toList(v) {
  return Data_Map_Internal.keys(v);
};

var toUnfoldable = function toUnfoldable(dictUnfoldable) {
  var $63 = Data_List.toUnfoldable(dictUnfoldable);
  return function ($64) {
    return $63(toList($64));
  };
};

var size = function size(v) {
  return Data_Map_Internal.size(v);
};

var singleton = function singleton(a) {
  return Data_Map_Internal.singleton(a)(Data_Unit.unit);
};

var showSet = function showSet(dictShow) {
  return new Data_Show.Show(function (s) {
    return "(fromFoldable " + (Data_Show.show(Data_List_Types.showList(dictShow))(toList(s)) + ")");
  });
};

var semigroupSet = function semigroupSet(dictOrd) {
  return new Data_Semigroup.Semigroup(union(dictOrd));
};

var member = function member(dictOrd) {
  return function (a) {
    return function (v) {
      return Data_Map_Internal.member(dictOrd)(a)(v);
    };
  };
};

var isEmpty = function isEmpty(v) {
  return Data_Map_Internal.isEmpty(v);
};

var insert = function insert(dictOrd) {
  return function (a) {
    return function (v) {
      return Data_Map_Internal.insert(dictOrd)(a)(Data_Unit.unit)(v);
    };
  };
};

var foldableSet = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    var $65 = Data_Foldable.foldMap(Data_List_Types.foldableList)(dictMonoid)(f);
    return function ($66) {
      return $65(toList($66));
    };
  };
}, function (f) {
  return function (x) {
    var $67 = Data_Foldable.foldl(Data_List_Types.foldableList)(f)(x);
    return function ($68) {
      return $67(toList($68));
    };
  };
}, function (f) {
  return function (x) {
    var $69 = Data_Foldable.foldr(Data_List_Types.foldableList)(f)(x);
    return function ($70) {
      return $69(toList($70));
    };
  };
});

var findMin = function findMin(v) {
  return Data_Functor.map(Data_Maybe.functorMaybe)(function (v1) {
    return v1.key;
  })(Data_Map_Internal.findMin(v));
};

var findMax = function findMax(v) {
  return Data_Functor.map(Data_Maybe.functorMaybe)(function (v1) {
    return v1.key;
  })(Data_Map_Internal.findMax(v));
};

var filter = function filter(dictOrd) {
  return function (f) {
    return function (v) {
      return Data_Map_Internal.filterWithKey(dictOrd)(function (k) {
        return function (v1) {
          return f(k);
        };
      })(v);
    };
  };
};

var eqSet = function eqSet(dictEq) {
  return new Data_Eq.Eq(function (v) {
    return function (v1) {
      return Data_Eq.eq(Data_Map_Internal.eqMap(dictEq)(Data_Eq.eqUnit))(v)(v1);
    };
  });
};

var ordSet = function ordSet(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqSet(dictOrd.Eq0());
  }, function (s1) {
    return function (s2) {
      return Data_Ord.compare(Data_List_Types.ordList(dictOrd))(toList(s1))(toList(s2));
    };
  });
};

var eq1Set = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqSet(dictEq));
});
var ord1Set = new Data_Ord.Ord1(function () {
  return eq1Set;
}, function (dictOrd) {
  return Data_Ord.compare(ordSet(dictOrd));
});
var empty = Data_Map_Internal.empty;

var fromFoldable = function fromFoldable(dictFoldable) {
  return function (dictOrd) {
    return Data_Foldable.foldl(dictFoldable)(function (m) {
      return function (a) {
        return insert(dictOrd)(a)(m);
      };
    })(empty);
  };
};

var intersection = function intersection(dictOrd) {
  return function (s1) {
    return function (s2) {
      var toArray = function () {
        var $71 = Data_Array.fromFoldable(Data_List_Types.foldableList);
        return function ($72) {
          return $71(toList($72));
        };
      }();

      var rs = toArray(s2);
      var rl = Data_Array.length(rs);
      var ls = toArray(s1);
      var ll = Data_Array.length(ls);

      var intersect = function intersect(acc) {
        var go = function go(l) {
          return function (r) {
            var $58 = l < ll && r < rl;

            if ($58) {
              var v = Data_Ord.compare(dictOrd)(ls[l])(rs[r]);

              if (v instanceof Data_Ordering.EQ) {
                return function __do() {
                  Data_Array_ST.push(ls[l])(acc)();
                  return new Control_Monad_Rec_Class.Loop({
                    a: l + 1 | 0,
                    b: r + 1 | 0
                  });
                };
              }

              ;

              if (v instanceof Data_Ordering.LT) {
                return Control_Applicative.pure(Control_Monad_ST_Internal.applicativeST)(new Control_Monad_Rec_Class.Loop({
                  a: l + 1 | 0,
                  b: r
                }));
              }

              ;

              if (v instanceof Data_Ordering.GT) {
                return Control_Applicative.pure(Control_Monad_ST_Internal.applicativeST)(new Control_Monad_Rec_Class.Loop({
                  a: l,
                  b: r + 1 | 0
                }));
              }

              ;
              throw new Error("Failed pattern match at Data.Set (line 176, column 12 - line 181, column 43): " + [v.constructor.name]);
            }

            ;
            return Control_Applicative.pure(Control_Monad_ST_Internal.applicativeST)(new Control_Monad_Rec_Class.Done(acc));
          };
        };

        return Control_Monad_Rec_Class.tailRecM2(Control_Monad_ST_Internal.monadRecST)(go)(0)(0);
      };

      return fromFoldable(Data_Foldable.foldableArray)(dictOrd)(Control_Bind.bind(Control_Monad_ST_Internal.bindST)(Control_Bind.bind(Control_Monad_ST_Internal.bindST)(Data_Array_ST.empty)(intersect))(Data_Array_ST.unsafeFreeze)());
    };
  };
};

var map = function map(dictOrd) {
  return function (f) {
    return Data_Foldable.foldl(foldableSet)(function (m) {
      return function (a) {
        return insert(dictOrd)(f(a))(m);
      };
    })(empty);
  };
};

var mapMaybe = function mapMaybe(dictOrd) {
  return function (f) {
    return Data_Foldable.foldr(foldableSet)(function (a) {
      return function (acc) {
        return Data_Maybe.maybe(acc)(function (b) {
          return insert(dictOrd)(b)(acc);
        })(f(a));
      };
    })(empty);
  };
};

var monoidSet = function monoidSet(dictOrd) {
  return new Data_Monoid.Monoid(function () {
    return semigroupSet(dictOrd);
  }, empty);
};

var unions = function unions(dictFoldable) {
  return function (dictOrd) {
    return Data_Foldable.foldl(dictFoldable)(union(dictOrd))(empty);
  };
};

var $$delete = function $$delete(dictOrd) {
  return function (a) {
    return function (v) {
      return Data_Map_Internal["delete"](dictOrd)(a)(v);
    };
  };
};

var difference = function difference(dictOrd) {
  return function (s1) {
    return function (s2) {
      return Data_Foldable.foldl(Data_List_Types.foldableList)(Data_Function.flip($$delete(dictOrd)))(s1)(toList(s2));
    };
  };
};

var subset = function subset(dictOrd) {
  return function (s1) {
    return function (s2) {
      return isEmpty(difference(dictOrd)(s1)(s2));
    };
  };
};

var properSubset = function properSubset(dictOrd) {
  return function (s1) {
    return function (s2) {
      return subset(dictOrd)(s1)(s2) && Data_Eq.notEq(eqSet(dictOrd.Eq0()))(s1)(s2);
    };
  };
};

var checkValid = function checkValid(v) {
  return Data_Map_Internal.checkValid(v);
};

module.exports = {
  fromFoldable: fromFoldable,
  toUnfoldable: toUnfoldable,
  empty: empty,
  isEmpty: isEmpty,
  singleton: singleton,
  map: map,
  checkValid: checkValid,
  insert: insert,
  member: member,
  "delete": $$delete,
  size: size,
  findMin: findMin,
  findMax: findMax,
  union: union,
  unions: unions,
  difference: difference,
  subset: subset,
  properSubset: properSubset,
  intersection: intersection,
  filter: filter,
  mapMaybe: mapMaybe,
  eqSet: eqSet,
  eq1Set: eq1Set,
  showSet: showSet,
  ordSet: ordSet,
  ord1Set: ord1Set,
  monoidSet: monoidSet,
  semigroupSet: semigroupSet,
  foldableSet: foldableSet
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Control.Monad.Rec.Class/index.js":"../output/Control.Monad.Rec.Class/index.js","../Control.Monad.ST.Internal/index.js":"../output/Control.Monad.ST.Internal/index.js","../Data.Array/index.js":"../output/Data.Array/index.js","../Data.Array.ST/index.js":"../output/Data.Array.ST/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.List/index.js":"../output/Data.List/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Map.Internal/index.js":"../output/Data.Map.Internal/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Ordering/index.js":"../output/Data.Ordering/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Lens.Index/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Data_Array = require("../Data.Array/index.js");

var Data_Array_NonEmpty = require("../Data.Array.NonEmpty/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Lens_Internal_Wander = require("../Data.Lens.Internal.Wander/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Map_Internal = require("../Data.Map.Internal/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Set = require("../Data.Set/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Foreign_Object = require("../Foreign.Object/index.js");

var Index = function Index(ix) {
  this.ix = ix;
};

var ix = function ix(dict) {
  return dict.ix;
};

var indexSet = function indexSet(dictOrd) {
  return new Index(function (x) {
    return function (dictWander) {
      return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
        return function (coalg) {
          var $40 = Control_Applicative.pure(dictApplicative);
          var $41 = Data_Set.insert(dictOrd)(x);
          return function ($42) {
            return $40($41($42));
          };
        };
      });
    };
  });
};

var indexNonEmptyArray = new Index(function (n) {
  return function (dictWander) {
    return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
      return function (coalg) {
        return function (xs) {
          return Data_Maybe.maybe(Control_Applicative.pure(dictApplicative)(xs))(function () {
            var $43 = Data_Functor.map(dictApplicative.Apply0().Functor0())(function (x) {
              return Data_Maybe.fromMaybe(xs)(Data_Array_NonEmpty.updateAt(n)(x)(xs));
            });
            return function ($44) {
              return $43(coalg($44));
            };
          }())(Data_Array_NonEmpty.index(xs)(n));
        };
      };
    });
  };
});
var indexMaybe = new Index(function (v) {
  return function (dictWander) {
    return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
      return Data_Traversable.traverse(Data_Traversable.traversableMaybe)(dictApplicative);
    });
  };
});

var indexMap = function indexMap(dictOrd) {
  return new Index(function (k) {
    return function (dictWander) {
      return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
        return function (coalg) {
          return function (m) {
            return Data_Maybe.maybe(Control_Applicative.pure(dictApplicative)(m))(function () {
              var $45 = Data_Functor.map(dictApplicative.Apply0().Functor0())(function (v) {
                return Data_Map_Internal.insert(dictOrd)(k)(v)(m);
              });
              return function ($46) {
                return $45(coalg($46));
              };
            }())(Data_Map_Internal.lookup(dictOrd)(k)(m));
          };
        };
      });
    };
  });
};

var indexList = new Index(function (n) {
  return function (dictWander) {
    if (n < 0) {
      return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
        return function (v) {
          return function (xs) {
            return Control_Applicative.pure(dictApplicative)(xs);
          };
        };
      });
    }

    ;

    if (Data_Boolean.otherwise) {
      var go = function go(dictApplicative) {
        return function (v) {
          return function (v1) {
            return function (v2) {
              if (v instanceof Data_List_Types.Nil) {
                return Control_Applicative.pure(dictApplicative)(Data_List_Types.Nil.value);
              }

              ;

              if (v instanceof Data_List_Types.Cons && v1 === 0) {
                return Data_Functor.mapFlipped(dictApplicative.Apply0().Functor0())(v2(v.value0))(function (v3) {
                  return new Data_List_Types.Cons(v3, v.value1);
                });
              }

              ;

              if (v instanceof Data_List_Types.Cons) {
                return Data_Functor.map(dictApplicative.Apply0().Functor0())(function (v3) {
                  return new Data_List_Types.Cons(v.value0, v3);
                })(go(dictApplicative)(v.value1)(v1 - 1 | 0)(v2));
              }

              ;
              throw new Error("Failed pattern match at Data.Lens.Index (line 83, column 5 - line 83, column 79): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
            };
          };
        };
      };

      return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
        return function (coalg) {
          return function (xs) {
            return go(dictApplicative)(xs)(n)(coalg);
          };
        };
      });
    }

    ;
    throw new Error("Failed pattern match at Data.Lens.Index (line 80, column 1 - line 86, column 56): " + [n.constructor.name]);
  };
});
var indexIdentity = new Index(function (v) {
  return function (dictWander) {
    return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
      return Data_Traversable.traverse(Data_Identity.traversableIdentity)(dictApplicative);
    });
  };
});
var indexForeignObject = new Index(function (k) {
  return function (dictWander) {
    return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
      return function (coalg) {
        return function (m) {
          return Data_Maybe.maybe(Control_Applicative.pure(dictApplicative)(m))(function () {
            var $47 = Data_Functor.map(dictApplicative.Apply0().Functor0())(function (v) {
              return Foreign_Object.insert(k)(v)(m);
            });
            return function ($48) {
              return $47(coalg($48));
            };
          }())(Foreign_Object.lookup(k)(m));
        };
      };
    });
  };
});
var indexArray = new Index(function (n) {
  return function (dictWander) {
    return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
      return function (coalg) {
        return function (xs) {
          return Data_Maybe.maybe(Control_Applicative.pure(dictApplicative)(xs))(function () {
            var $49 = Data_Functor.map(dictApplicative.Apply0().Functor0())(function (x) {
              return Data_Maybe.fromMaybe(xs)(Data_Array.updateAt(n)(x)(xs));
            });
            return function ($50) {
              return $49(coalg($50));
            };
          }())(Data_Array.index(xs)(n));
        };
      };
    });
  };
});

var indexArr = function indexArr(dictEq) {
  return new Index(function (i) {
    return function (dictWander) {
      return Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
        return function (coalg) {
          return function (f) {
            return Data_Functor.mapFlipped(dictApplicative.Apply0().Functor0())(coalg(f(i)))(function (a) {
              return function (j) {
                var $39 = Data_Eq.eq(dictEq)(i)(j);

                if ($39) {
                  return a;
                }

                ;
                return f(j);
              };
            });
          };
        };
      });
    };
  });
};

module.exports = {
  Index: Index,
  ix: ix,
  indexArr: indexArr,
  indexMaybe: indexMaybe,
  indexIdentity: indexIdentity,
  indexArray: indexArray,
  indexNonEmptyArray: indexNonEmptyArray,
  indexList: indexList,
  indexSet: indexSet,
  indexMap: indexMap,
  indexForeignObject: indexForeignObject
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Data.Array/index.js":"../output/Data.Array/index.js","../Data.Array.NonEmpty/index.js":"../output/Data.Array.NonEmpty/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Lens.Internal.Wander/index.js":"../output/Data.Lens.Internal.Wander/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Map.Internal/index.js":"../output/Data.Map.Internal/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Set/index.js":"../output/Data.Set/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Foreign.Object/index.js":"../output/Foreign.Object/index.js"}],"../output/Data.Lens.Internal.Indexed/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Either = require("../Data.Either/index.js");

var Data_Lens_Internal_Wander = require("../Data.Lens.Internal.Wander/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Indexed = function Indexed(x) {
  return x;
};

var profunctorIndexed = function profunctorIndexed(dictProfunctor) {
  return new Data_Profunctor.Profunctor(function (f) {
    return function (g) {
      return function (v) {
        return Data_Profunctor.dimap(dictProfunctor)(Data_Profunctor_Strong.second(Data_Profunctor_Strong.strongFn)(f))(g)(v);
      };
    };
  });
};

var strongIndexed = function strongIndexed(dictStrong) {
  return new Data_Profunctor_Strong.Strong(function () {
    return profunctorIndexed(dictStrong.Profunctor0());
  }, function (v) {
    return Indexed(Data_Profunctor.lcmap(dictStrong.Profunctor0())(function (v1) {
      return new Data_Tuple.Tuple(new Data_Tuple.Tuple(v1.value0, v1.value1.value0), v1.value1.value1);
    })(Data_Profunctor_Strong.first(dictStrong)(v)));
  }, function (v) {
    return Indexed(Data_Profunctor.lcmap(dictStrong.Profunctor0())(function (v1) {
      return new Data_Tuple.Tuple(v1.value1.value0, new Data_Tuple.Tuple(v1.value0, v1.value1.value1));
    })(Data_Profunctor_Strong.second(dictStrong)(v)));
  });
};

var newtypeIndexed = new Data_Newtype.Newtype(function (n) {
  return n;
}, Indexed);

var choiceIndexed = function choiceIndexed(dictChoice) {
  return new Data_Profunctor_Choice.Choice(function () {
    return profunctorIndexed(dictChoice.Profunctor0());
  }, function (v) {
    return Indexed(Data_Profunctor.lcmap(dictChoice.Profunctor0())(function (v1) {
      return Data_Either.either(function () {
        var $47 = Data_Tuple.Tuple.create(v1.value0);
        return function ($48) {
          return Data_Either.Left.create($47($48));
        };
      }())(Data_Either.Right.create)(v1.value1);
    })(Data_Profunctor_Choice.left(dictChoice)(v)));
  }, function (v) {
    return Indexed(Data_Profunctor.lcmap(dictChoice.Profunctor0())(function (v1) {
      return Data_Either.either(Data_Either.Left.create)(function () {
        var $49 = Data_Tuple.Tuple.create(v1.value0);
        return function ($50) {
          return Data_Either.Right.create($49($50));
        };
      }())(v1.value1);
    })(Data_Profunctor_Choice.right(dictChoice)(v)));
  });
};

var wanderIndexed = function wanderIndexed(dictWander) {
  return new Data_Lens_Internal_Wander.Wander(function () {
    return choiceIndexed(dictWander.Choice1());
  }, function () {
    return strongIndexed(dictWander.Strong0());
  }, function (trav) {
    return function (v) {
      return Indexed(Data_Lens_Internal_Wander.wander(dictWander)(function (dictApplicative) {
        return function (ia2fb) {
          return function (v1) {
            return trav(dictApplicative)(function () {
              var $51 = Data_Tuple.Tuple.create(v1.value0);
              return function ($52) {
                return ia2fb($51($52));
              };
            }())(v1.value1);
          };
        };
      })(v));
    };
  });
};

module.exports = {
  Indexed: Indexed,
  newtypeIndexed: newtypeIndexed,
  profunctorIndexed: profunctorIndexed,
  strongIndexed: strongIndexed,
  choiceIndexed: choiceIndexed,
  wanderIndexed: wanderIndexed
};
},{"../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Lens.Internal.Wander/index.js":"../output/Data.Lens.Internal.Wander/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Lens.Internal.Shop/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Shop = function () {
  function Shop(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Shop.create = function (value0) {
    return function (value1) {
      return new Shop(value0, value1);
    };
  };

  return Shop;
}();

var profunctorShop = new Data_Profunctor.Profunctor(function (f) {
  return function (g) {
    return function (v) {
      return new Shop(function ($30) {
        return v.value0(f($30));
      }, function (s) {
        var $31 = v.value1(f(s));
        return function ($32) {
          return g($31($32));
        };
      });
    };
  };
});
var strongShop = new Data_Profunctor_Strong.Strong(function () {
  return profunctorShop;
}, function (v) {
  return new Shop(function (v1) {
    return v.value0(v1.value0);
  }, function (v1) {
    return function (b) {
      return new Data_Tuple.Tuple(v.value1(v1.value0)(b), v1.value1);
    };
  });
}, function (v) {
  return new Shop(function (v1) {
    return v.value0(v1.value1);
  }, function (v1) {
    return function (b) {
      return new Data_Tuple.Tuple(v1.value0, v.value1(v1.value1)(b));
    };
  });
});
module.exports = {
  Shop: Shop,
  profunctorShop: profunctorShop,
  strongShop: strongShop
};
},{"../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Lens.Lens/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Apply = require("../Control.Apply/index.js");

var Control_Category = require("../Control.Category/index.js");

var Data_Lens_Internal_Indexed = require("../Data.Lens.Internal.Indexed/index.js");

var Data_Lens_Internal_Shop = require("../Data.Lens.Internal.Shop/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var withLens = function withLens(l) {
  return function (f) {
    var v = l(new Data_Lens_Internal_Shop.Shop(Control_Category.identity(Control_Category.categoryFn), function (v1) {
      return function (b) {
        return b;
      };
    }));
    return f(v.value0)(v.value1);
  };
};

var withIndexedLens = function withIndexedLens(l) {
  return function (f) {
    var v = l(new Data_Lens_Internal_Shop.Shop(Control_Category.identity(Control_Category.categoryFn), function (v1) {
      return function (b) {
        return b;
      };
    }));
    return f(v.value0)(v.value1);
  };
};

var lensStore = function lensStore(l) {
  return withLens(l)(Control_Apply.lift2(Control_Apply.applyFn)(Data_Tuple.Tuple.create));
};

var lens$prime = function lens$prime(to) {
  return function (dictStrong) {
    return function (pab) {
      return Data_Profunctor.dimap(dictStrong.Profunctor0())(to)(function (v) {
        return v.value1(v.value0);
      })(Data_Profunctor_Strong.first(dictStrong)(pab));
    };
  };
};

var lens = function lens(get) {
  return function (set) {
    return function (dictStrong) {
      return lens$prime(function (s) {
        return new Data_Tuple.Tuple(get(s), function (b) {
          return set(s)(b);
        });
      })(dictStrong);
    };
  };
};

var ilens$prime = function ilens$prime(to) {
  return function (dictStrong) {
    return function (pab) {
      return Data_Profunctor.dimap(dictStrong.Profunctor0())(to)(function (v) {
        return v.value1(v.value0);
      })(Data_Profunctor_Strong.first(dictStrong)(Data_Newtype.un(Data_Lens_Internal_Indexed.newtypeIndexed)(Data_Lens_Internal_Indexed.Indexed)(pab)));
    };
  };
};

var ilens = function ilens(get) {
  return function (set) {
    return function (dictStrong) {
      return ilens$prime(function (s) {
        return new Data_Tuple.Tuple(get(s), function (b) {
          return set(s)(b);
        });
      })(dictStrong);
    };
  };
};

var cloneLens = function cloneLens(l) {
  return function (dictStrong) {
    return withLens(l)(function (x) {
      return function (y) {
        return function (p) {
          return lens(x)(y)(dictStrong)(p);
        };
      };
    });
  };
};

var cloneIndexedLens = function cloneIndexedLens(l) {
  return function (dictStrong) {
    return withIndexedLens(l)(function (x) {
      return function (y) {
        return function (p) {
          return ilens(x)(y)(dictStrong)(p);
        };
      };
    });
  };
};

module.exports = {
  lens: lens,
  "lens'": lens$prime,
  withLens: withLens,
  cloneLens: cloneLens,
  ilens: ilens,
  "ilens'": ilens$prime,
  withIndexedLens: withIndexedLens,
  cloneIndexedLens: cloneIndexedLens,
  lensStore: lensStore
};
},{"../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Lens.Internal.Indexed/index.js":"../output/Data.Lens.Internal.Indexed/index.js","../Data.Lens.Internal.Shop/index.js":"../output/Data.Lens.Internal.Shop/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Lens.At/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Identity = require("../Data.Identity/index.js");

var Data_Lens_Index = require("../Data.Lens.Index/index.js");

var Data_Lens_Lens = require("../Data.Lens.Lens/index.js");

var Data_Map_Internal = require("../Data.Map.Internal/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Set = require("../Data.Set/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Foreign_Object = require("../Foreign.Object/index.js");

var At = function At(Index0, at) {
  this.Index0 = Index0;
  this.at = at;
};

var atSet = function atSet(dictOrd) {
  return new At(function () {
    return Data_Lens_Index.indexSet(dictOrd);
  }, function (x) {
    return function (dictStrong) {
      var update = function update(v) {
        if (v instanceof Data_Maybe.Nothing) {
          return Data_Set["delete"](dictOrd)(x);
        }

        ;

        if (v instanceof Data_Maybe.Just) {
          return Data_Set.insert(dictOrd)(x);
        }

        ;
        throw new Error("Failed pattern match at Data.Lens.At (line 51, column 7 - line 51, column 34): " + [v.constructor.name]);
      };

      var get = function get(xs) {
        var $13 = Data_Set.member(dictOrd)(x)(xs);

        if ($13) {
          return new Data_Maybe.Just(Data_Unit.unit);
        }

        ;
        return Data_Maybe.Nothing.value;
      };

      return Data_Lens_Lens.lens(get)(Data_Function.flip(update))(dictStrong);
    };
  });
};

var atMaybe = new At(function () {
  return Data_Lens_Index.indexMaybe;
}, function (v) {
  return function (dictStrong) {
    return Data_Lens_Lens.lens(Control_Category.identity(Control_Category.categoryFn))(function (v1) {
      return Control_Category.identity(Control_Category.categoryFn);
    })(dictStrong);
  };
});

var atMap = function atMap(dictOrd) {
  return new At(function () {
    return Data_Lens_Index.indexMap(dictOrd);
  }, function (k) {
    return function (dictStrong) {
      return Data_Lens_Lens.lens(Data_Map_Internal.lookup(dictOrd)(k))(function (m) {
        return Data_Maybe.maybe(Data_Map_Internal["delete"](dictOrd)(k)(m))(function (v) {
          return Data_Map_Internal.insert(dictOrd)(k)(v)(m);
        });
      })(dictStrong);
    };
  });
};

var atIdentity = new At(function () {
  return Data_Lens_Index.indexIdentity;
}, function (v) {
  return function (dictStrong) {
    return Data_Lens_Lens.lens(function () {
      var $14 = Data_Newtype.unwrap(Data_Identity.newtypeIdentity);
      return function ($15) {
        return Data_Maybe.Just.create($14($15));
      };
    }())(Data_Function.flip(Data_Maybe.maybe)(Data_Identity.Identity))(dictStrong);
  };
});
var atForeignObject = new At(function () {
  return Data_Lens_Index.indexForeignObject;
}, function (k) {
  return function (dictStrong) {
    return Data_Lens_Lens.lens(Foreign_Object.lookup(k))(function (m) {
      return Data_Maybe.maybe(Foreign_Object["delete"](k)(m))(function (v) {
        return Foreign_Object.insert(k)(v)(m);
      });
    })(dictStrong);
  };
});

var at = function at(dict) {
  return dict.at;
};

module.exports = {
  At: At,
  at: at,
  atIdentity: atIdentity,
  atMaybe: atMaybe,
  atSet: atSet,
  atMap: atMap,
  atForeignObject: atForeignObject
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Identity/index.js":"../output/Data.Identity/index.js","../Data.Lens.Index/index.js":"../output/Data.Lens.Index/index.js","../Data.Lens.Lens/index.js":"../output/Data.Lens.Lens/index.js","../Data.Map.Internal/index.js":"../output/Data.Map.Internal/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Set/index.js":"../output/Data.Set/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Foreign.Object/index.js":"../output/Foreign.Object/index.js"}],"../output/Data.Functor.Contravariant/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Functor = require("../Data.Functor/index.js");

var Data_Void = require("../Data.Void/index.js");

var Contravariant = function Contravariant(cmap) {
  this.cmap = cmap;
};

var cmap = function cmap(dict) {
  return dict.cmap;
};

var cmapFlipped = function cmapFlipped(dictContravariant) {
  return function (x) {
    return function (f) {
      return cmap(dictContravariant)(f)(x);
    };
  };
};

var coerce = function coerce(dictContravariant) {
  return function (dictFunctor) {
    return function (a) {
      return Data_Functor.map(dictFunctor)(Data_Void.absurd)(cmap(dictContravariant)(Data_Void.absurd)(a));
    };
  };
};

var imapC = function imapC(dictContravariant) {
  return function (v) {
    return function (f) {
      return cmap(dictContravariant)(f);
    };
  };
};

module.exports = {
  cmap: cmap,
  Contravariant: Contravariant,
  cmapFlipped: cmapFlipped,
  coerce: coerce,
  imapC: imapC
};
},{"../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Void/index.js":"../output/Data.Void/index.js"}],"../output/Data.Const/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Applicative = require("../Control.Applicative/index.js");

var Control_Apply = require("../Control.Apply/index.js");

var Control_Semigroupoid = require("../Control.Semigroupoid/index.js");

var Data_Bifoldable = require("../Data.Bifoldable/index.js");

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Bitraversable = require("../Data.Bitraversable/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_FoldableWithIndex = require("../Data.FoldableWithIndex/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Functor_Contravariant = require("../Data.Functor.Contravariant/index.js");

var Data_Functor_Invariant = require("../Data.Functor.Invariant/index.js");

var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Data_TraversableWithIndex = require("../Data.TraversableWithIndex/index.js");

var Const = function Const(x) {
  return x;
};

var showConst = function showConst(dictShow) {
  return new Data_Show.Show(function (v) {
    return "(Const " + (Data_Show.show(dictShow)(v) + ")");
  });
};

var semiringConst = function semiringConst(dictSemiring) {
  return dictSemiring;
};

var semigroupoidConst = new Control_Semigroupoid.Semigroupoid(function (v) {
  return function (v1) {
    return v1;
  };
});

var semigroupConst = function semigroupConst(dictSemigroup) {
  return dictSemigroup;
};

var ringConst = function ringConst(dictRing) {
  return dictRing;
};

var ordConst = function ordConst(dictOrd) {
  return dictOrd;
};

var newtypeConst = new Data_Newtype.Newtype(function (n) {
  return n;
}, Const);

var monoidConst = function monoidConst(dictMonoid) {
  return dictMonoid;
};

var heytingAlgebraConst = function heytingAlgebraConst(dictHeytingAlgebra) {
  return dictHeytingAlgebra;
};

var functorConst = new Data_Functor.Functor(function (f) {
  return function (m) {
    return m;
  };
});
var functorWithIndexConst = new Data_FunctorWithIndex.FunctorWithIndex(function () {
  return functorConst;
}, function (v) {
  return function (v1) {
    return v1;
  };
});
var invariantConst = new Data_Functor_Invariant.Invariant(Data_Functor_Invariant.imapF(functorConst));
var foldableConst = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (v) {
    return function (v1) {
      return Data_Monoid.mempty(dictMonoid);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      return z;
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      return z;
    };
  };
});
var foldableWithIndexConst = new Data_FoldableWithIndex.FoldableWithIndex(function () {
  return foldableConst;
}, function (dictMonoid) {
  return function (v) {
    return function (v1) {
      return Data_Monoid.mempty(dictMonoid);
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      return z;
    };
  };
}, function (v) {
  return function (z) {
    return function (v1) {
      return z;
    };
  };
});
var traversableConst = new Data_Traversable.Traversable(function () {
  return foldableConst;
}, function () {
  return functorConst;
}, function (dictApplicative) {
  return function (v) {
    return Control_Applicative.pure(dictApplicative)(v);
  };
}, function (dictApplicative) {
  return function (v) {
    return function (v1) {
      return Control_Applicative.pure(dictApplicative)(v1);
    };
  };
});
var traversableWithIndexConst = new Data_TraversableWithIndex.TraversableWithIndex(function () {
  return foldableWithIndexConst;
}, function () {
  return functorWithIndexConst;
}, function () {
  return traversableConst;
}, function (dictApplicative) {
  return function (v) {
    return function (v1) {
      return Control_Applicative.pure(dictApplicative)(v1);
    };
  };
});

var euclideanRingConst = function euclideanRingConst(dictEuclideanRing) {
  return dictEuclideanRing;
};

var eqConst = function eqConst(dictEq) {
  return dictEq;
};

var eq1Const = function eq1Const(dictEq) {
  return new Data_Eq.Eq1(function (dictEq1) {
    return Data_Eq.eq(eqConst(dictEq));
  });
};

var ord1Const = function ord1Const(dictOrd) {
  return new Data_Ord.Ord1(function () {
    return eq1Const(dictOrd.Eq0());
  }, function (dictOrd1) {
    return Data_Ord.compare(ordConst(dictOrd));
  });
};

var contravariantConst = new Data_Functor_Contravariant.Contravariant(function (v) {
  return function (v1) {
    return v1;
  };
});

var commutativeRingConst = function commutativeRingConst(dictCommutativeRing) {
  return dictCommutativeRing;
};

var boundedConst = function boundedConst(dictBounded) {
  return dictBounded;
};

var booleanAlgebraConst = function booleanAlgebraConst(dictBooleanAlgebra) {
  return dictBooleanAlgebra;
};

var bifunctorConst = new Data_Bifunctor.Bifunctor(function (f) {
  return function (v) {
    return function (v1) {
      return f(v1);
    };
  };
});
var bifoldableConst = new Data_Bifoldable.Bifoldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return function (v1) {
        return f(v1);
      };
    };
  };
}, function (f) {
  return function (v) {
    return function (z) {
      return function (v1) {
        return f(z)(v1);
      };
    };
  };
}, function (f) {
  return function (v) {
    return function (z) {
      return function (v1) {
        return f(v1)(z);
      };
    };
  };
});
var bitraversableConst = new Data_Bitraversable.Bitraversable(function () {
  return bifoldableConst;
}, function () {
  return bifunctorConst;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Const)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return function (v1) {
        return Data_Functor.map(dictApplicative.Apply0().Functor0())(Const)(f(v1));
      };
    };
  };
});

var applyConst = function applyConst(dictSemigroup) {
  return new Control_Apply.Apply(function () {
    return functorConst;
  }, function (v) {
    return function (v1) {
      return Data_Semigroup.append(dictSemigroup)(v)(v1);
    };
  });
};

var applicativeConst = function applicativeConst(dictMonoid) {
  return new Control_Applicative.Applicative(function () {
    return applyConst(dictMonoid.Semigroup0());
  }, function (v) {
    return Data_Monoid.mempty(dictMonoid);
  });
};

module.exports = {
  Const: Const,
  newtypeConst: newtypeConst,
  eqConst: eqConst,
  eq1Const: eq1Const,
  ordConst: ordConst,
  ord1Const: ord1Const,
  boundedConst: boundedConst,
  showConst: showConst,
  semigroupoidConst: semigroupoidConst,
  semigroupConst: semigroupConst,
  monoidConst: monoidConst,
  semiringConst: semiringConst,
  ringConst: ringConst,
  euclideanRingConst: euclideanRingConst,
  commutativeRingConst: commutativeRingConst,
  heytingAlgebraConst: heytingAlgebraConst,
  booleanAlgebraConst: booleanAlgebraConst,
  functorConst: functorConst,
  bifunctorConst: bifunctorConst,
  functorWithIndexConst: functorWithIndexConst,
  invariantConst: invariantConst,
  contravariantConst: contravariantConst,
  applyConst: applyConst,
  applicativeConst: applicativeConst,
  foldableConst: foldableConst,
  foldableWithIndexConst: foldableWithIndexConst,
  bifoldableConst: bifoldableConst,
  traversableConst: traversableConst,
  traversableWithIndexConst: traversableWithIndexConst,
  bitraversableConst: bitraversableConst
};
},{"../Control.Applicative/index.js":"../output/Control.Applicative/index.js","../Control.Apply/index.js":"../output/Control.Apply/index.js","../Control.Semigroupoid/index.js":"../output/Control.Semigroupoid/index.js","../Data.Bifoldable/index.js":"../output/Data.Bifoldable/index.js","../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Bitraversable/index.js":"../output/Data.Bitraversable/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.FoldableWithIndex/index.js":"../output/Data.FoldableWithIndex/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Functor.Contravariant/index.js":"../output/Data.Functor.Contravariant/index.js","../Data.Functor.Invariant/index.js":"../output/Data.Functor.Invariant/index.js","../Data.FunctorWithIndex/index.js":"../output/Data.FunctorWithIndex/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js","../Data.TraversableWithIndex/index.js":"../output/Data.TraversableWithIndex/index.js"}],"../output/Data.Profunctor.Cochoice/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Cochoice = function Cochoice(Profunctor0, unleft, unright) {
  this.Profunctor0 = Profunctor0;
  this.unleft = unleft;
  this.unright = unright;
};

var unright = function unright(dict) {
  return dict.unright;
};

var unleft = function unleft(dict) {
  return dict.unleft;
};

module.exports = {
  unleft: unleft,
  unright: unright,
  Cochoice: Cochoice
};
},{}],"../output/Data.Lens.Internal.Forget/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Const = require("../Data.Const/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Lens_Internal_Wander = require("../Data.Lens.Internal.Wander/index.js");

var Data_Monoid = require("../Data.Monoid/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var Data_Profunctor_Cochoice = require("../Data.Profunctor.Cochoice/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var Data_Semigroup = require("../Data.Semigroup/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var Forget = function Forget(x) {
  return x;
};

var semigroupForget = function semigroupForget(dictSemigroup) {
  return Data_Semigroup.semigroupFn(dictSemigroup);
};

var profunctorForget = new Data_Profunctor.Profunctor(function (f) {
  return function (v) {
    return function (v1) {
      return function ($27) {
        return v1(f($27));
      };
    };
  };
});
var strongForget = new Data_Profunctor_Strong.Strong(function () {
  return profunctorForget;
}, function (v) {
  return function ($28) {
    return v(Data_Tuple.fst($28));
  };
}, function (v) {
  return function ($29) {
    return v(Data_Tuple.snd($29));
  };
});
var newtypeForget = new Data_Newtype.Newtype(function (n) {
  return n;
}, Forget);

var monoidForget = function monoidForget(dictMonoid) {
  return Data_Monoid.monoidFn(dictMonoid);
};

var cochoiceForget = new Data_Profunctor_Cochoice.Cochoice(function () {
  return profunctorForget;
}, function (v) {
  return function ($30) {
    return v(Data_Either.Left.create($30));
  };
}, function (v) {
  return function ($31) {
    return v(Data_Either.Right.create($31));
  };
});

var choiceForget = function choiceForget(dictMonoid) {
  return new Data_Profunctor_Choice.Choice(function () {
    return profunctorForget;
  }, function (v) {
    return Data_Either.either(v)(Data_Monoid.mempty(Data_Monoid.monoidFn(dictMonoid)));
  }, function (v) {
    return Data_Either.either(Data_Monoid.mempty(Data_Monoid.monoidFn(dictMonoid)))(v);
  });
};

var wanderForget = function wanderForget(dictMonoid) {
  return new Data_Lens_Internal_Wander.Wander(function () {
    return choiceForget(dictMonoid);
  }, function () {
    return strongForget;
  }, function (f) {
    return function (v) {
      return Data_Newtype.alaF(Data_Functor.functorFn)(Data_Functor.functorFn)(Data_Const.newtypeConst)(Data_Const.newtypeConst)(Data_Const.Const)(f(Data_Const.applicativeConst(dictMonoid)))(v);
    };
  });
};

module.exports = {
  Forget: Forget,
  newtypeForget: newtypeForget,
  semigroupForget: semigroupForget,
  monoidForget: monoidForget,
  profunctorForget: profunctorForget,
  choiceForget: choiceForget,
  strongForget: strongForget,
  cochoiceForget: cochoiceForget,
  wanderForget: wanderForget
};
},{"../Data.Const/index.js":"../output/Data.Const/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Lens.Internal.Wander/index.js":"../output/Data.Lens.Internal.Wander/index.js","../Data.Monoid/index.js":"../output/Data.Monoid/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js","../Data.Profunctor.Cochoice/index.js":"../output/Data.Profunctor.Cochoice/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js","../Data.Semigroup/index.js":"../output/Data.Semigroup/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Lens.Getter/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Control_Monad_State_Class = require("../Control.Monad.State.Class/index.js");

var Data_Lens_Internal_Forget = require("../Data.Lens.Internal.Forget/index.js");

var Data_Lens_Internal_Indexed = require("../Data.Lens.Internal.Indexed/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var view = function view(l) {
  return Data_Newtype.unwrap(Data_Lens_Internal_Forget.newtypeForget)(l(Control_Category.identity(Control_Category.categoryFn)));
};

var viewOn = function viewOn(s) {
  return function (l) {
    return view(l)(s);
  };
};

var use = function use(dictMonadState) {
  return function (p) {
    return Control_Monad_State_Class.gets(dictMonadState)(function (v) {
      return viewOn(v)(p);
    });
  };
};

var to = function to(f) {
  return function (p) {
    var $3 = Data_Newtype.unwrap(Data_Lens_Internal_Forget.newtypeForget)(p);
    return function ($4) {
      return $3(f($4));
    };
  };
};

var takeBoth = function takeBoth(l) {
  return function (r) {
    return to(Data_Profunctor_Strong.fanout(Control_Category.categoryFn)(Data_Profunctor_Strong.strongFn)(view(l))(view(r)));
  };
};

var iview = function iview(l) {
  return Data_Newtype.unwrap(Data_Lens_Internal_Forget.newtypeForget)(l(Data_Lens_Internal_Indexed.Indexed(Control_Category.identity(Control_Category.categoryFn))));
};

var iuse = function iuse(dictMonadState) {
  return function (p) {
    return Control_Monad_State_Class.gets(dictMonadState)(iview(p));
  };
};

var cloneGetter = function cloneGetter(g) {
  return to(view(g));
};

module.exports = {
  viewOn: viewOn,
  view: view,
  to: to,
  takeBoth: takeBoth,
  use: use,
  iview: iview,
  iuse: iuse,
  cloneGetter: cloneGetter
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Control.Monad.State.Class/index.js":"../output/Control.Monad.State.Class/index.js","../Data.Lens.Internal.Forget/index.js":"../output/Data.Lens.Internal.Forget/index.js","../Data.Lens.Internal.Indexed/index.js":"../output/Data.Lens.Internal.Indexed/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js"}],"../output/Data.Lens.Internal.Exchange/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Functor = require("../Data.Functor/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Exchange = function () {
  function Exchange(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Exchange.create = function (value0) {
    return function (value1) {
      return new Exchange(value0, value1);
    };
  };

  return Exchange;
}();

var profunctorExchange = new Data_Profunctor.Profunctor(function (f) {
  return function (g) {
    return function (v) {
      return new Exchange(function ($11) {
        return v.value0(f($11));
      }, function ($12) {
        return g(v.value1($12));
      });
    };
  };
});
var functorExchange = new Data_Functor.Functor(function (f) {
  return function (v) {
    return new Exchange(v.value0, function ($13) {
      return f(v.value1($13));
    });
  };
});
module.exports = {
  Exchange: Exchange,
  functorExchange: functorExchange,
  profunctorExchange: profunctorExchange
};
},{"../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js"}],"../output/Data.Profunctor.Costrong/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Costrong = function Costrong(Profunctor0, unfirst, unsecond) {
  this.Profunctor0 = Profunctor0;
  this.unfirst = unfirst;
  this.unsecond = unsecond;
};

var unsecond = function unsecond(dict) {
  return dict.unsecond;
};

var unfirst = function unfirst(dict) {
  return dict.unfirst;
};

module.exports = {
  unfirst: unfirst,
  unsecond: unsecond,
  Costrong: Costrong
};
},{}],"../output/Data.Lens.Internal.Re/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var Data_Profunctor_Cochoice = require("../Data.Profunctor.Cochoice/index.js");

var Data_Profunctor_Costrong = require("../Data.Profunctor.Costrong/index.js");

var Data_Profunctor_Strong = require("../Data.Profunctor.Strong/index.js");

var Re = function Re(x) {
  return x;
};

var profunctorRe = function profunctorRe(dictProfunctor) {
  return new Data_Profunctor.Profunctor(function (f) {
    return function (g) {
      return function (v) {
        var $28 = Data_Profunctor.dimap(dictProfunctor)(g)(f);
        return function ($29) {
          return v($28($29));
        };
      };
    };
  });
};

var strongRe = function strongRe(dictStrong) {
  return new Data_Profunctor_Costrong.Costrong(function () {
    return profunctorRe(dictStrong.Profunctor0());
  }, function (v) {
    var $30 = Data_Profunctor_Strong.first(dictStrong);
    return function ($31) {
      return v($30($31));
    };
  }, function (v) {
    var $32 = Data_Profunctor_Strong.second(dictStrong);
    return function ($33) {
      return v($32($33));
    };
  });
};

var newtypeRe = new Data_Newtype.Newtype(function (n) {
  return n;
}, Re);

var costrongRe = function costrongRe(dictCostrong) {
  return new Data_Profunctor_Strong.Strong(function () {
    return profunctorRe(dictCostrong.Profunctor0());
  }, function (v) {
    var $34 = Data_Profunctor_Costrong.unfirst(dictCostrong);
    return function ($35) {
      return v($34($35));
    };
  }, function (v) {
    var $36 = Data_Profunctor_Costrong.unsecond(dictCostrong);
    return function ($37) {
      return v($36($37));
    };
  });
};

var cochoiceRe = function cochoiceRe(dictCochoice) {
  return new Data_Profunctor_Choice.Choice(function () {
    return profunctorRe(dictCochoice.Profunctor0());
  }, function (v) {
    var $38 = Data_Profunctor_Cochoice.unleft(dictCochoice);
    return function ($39) {
      return v($38($39));
    };
  }, function (v) {
    var $40 = Data_Profunctor_Cochoice.unright(dictCochoice);
    return function ($41) {
      return v($40($41));
    };
  });
};

var choiceRe = function choiceRe(dictChoice) {
  return new Data_Profunctor_Cochoice.Cochoice(function () {
    return profunctorRe(dictChoice.Profunctor0());
  }, function (v) {
    var $42 = Data_Profunctor_Choice.left(dictChoice);
    return function ($43) {
      return v($42($43));
    };
  }, function (v) {
    var $44 = Data_Profunctor_Choice.right(dictChoice);
    return function ($45) {
      return v($44($45));
    };
  });
};

module.exports = {
  Re: Re,
  newtypeRe: newtypeRe,
  profunctorRe: profunctorRe,
  choiceRe: choiceRe,
  cochoiceRe: cochoiceRe,
  strongRe: strongRe,
  costrongRe: costrongRe
};
},{"../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js","../Data.Profunctor.Cochoice/index.js":"../output/Data.Profunctor.Cochoice/index.js","../Data.Profunctor.Costrong/index.js":"../output/Data.Profunctor.Costrong/index.js","../Data.Profunctor.Strong/index.js":"../output/Data.Profunctor.Strong/index.js"}],"../output/Data.Lens.Iso/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Data_Boolean = require("../Data.Boolean/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Lens_Internal_Exchange = require("../Data.Lens.Internal.Exchange/index.js");

var Data_Lens_Internal_Re = require("../Data.Lens.Internal.Re/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var withIso = function withIso(l) {
  return function (f) {
    var v = l(new Data_Lens_Internal_Exchange.Exchange(Control_Category.identity(Control_Category.categoryFn), Control_Category.identity(Control_Category.categoryFn)));
    return f(v.value0)(v.value1);
  };
};

var under = function under(l) {
  return withIso(l)(function (sa) {
    return function (bt) {
      return function (ts) {
        return function ($19) {
          return sa(ts(bt($19)));
        };
      };
    };
  });
};

var re = function re(t) {
  return Data_Newtype.unwrap(Data_Lens_Internal_Re.newtypeRe)(t(Control_Category.identity(Control_Category.categoryFn)));
};

var iso = function iso(f) {
  return function (g) {
    return function (dictProfunctor) {
      return function (pab) {
        return Data_Profunctor.dimap(dictProfunctor)(f)(g)(pab);
      };
    };
  };
};

var mapping = function mapping(dictFunctor) {
  return function (dictFunctor1) {
    return function (l) {
      return function (dictProfunctor) {
        return withIso(l)(function (sa) {
          return function (bt) {
            return iso(Data_Functor.map(dictFunctor)(sa))(Data_Functor.map(dictFunctor1)(bt))(dictProfunctor);
          };
        });
      };
    };
  };
};

var non = function non(dictEq) {
  return function (def) {
    return function (dictProfunctor) {
      var g = function g(a) {
        if (Data_Eq.eq(dictEq)(a)(def)) {
          return Data_Maybe.Nothing.value;
        }

        ;

        if (Data_Boolean.otherwise) {
          return new Data_Maybe.Just(a);
        }

        ;
        throw new Error("Failed pattern match at Data.Lens.Iso (line 45, column 9 - line 46, column 33): " + [a.constructor.name]);
      };

      return iso(Data_Maybe.fromMaybe(def))(g)(dictProfunctor);
    };
  };
};

var uncurried = function uncurried(dictProfunctor) {
  return iso(Data_Tuple.uncurry)(Data_Tuple.curry)(dictProfunctor);
};

var flipped = function flipped(dictProfunctor) {
  return iso(Data_Function.flip)(Data_Function.flip)(dictProfunctor);
};

var dimapping = function dimapping(dictProfunctor) {
  return function (dictProfunctor1) {
    return function (f) {
      return function (g) {
        return function (dictProfunctor2) {
          return withIso(f)(function (sa) {
            return function (bt) {
              return withIso(g)(function (ssaa) {
                return function (bbtt) {
                  return iso(Data_Profunctor.dimap(dictProfunctor)(sa)(ssaa))(Data_Profunctor.dimap(dictProfunctor1)(bt)(bbtt))(dictProfunctor2);
                };
              });
            };
          });
        };
      };
    };
  };
};

var curried = function curried(dictProfunctor) {
  return iso(Data_Tuple.curry)(Data_Tuple.uncurry)(dictProfunctor);
};

var cloneIso = function cloneIso(l) {
  return function (dictProfunctor) {
    return withIso(l)(function (x) {
      return function (y) {
        return function (p) {
          return iso(x)(y)(dictProfunctor)(p);
        };
      };
    });
  };
};

var auf = function auf(dictProfunctor) {
  return function (l) {
    return withIso(l)(function (sa) {
      return function (bt) {
        return function (f) {
          return function (g) {
            return function (e) {
              return bt(f(Data_Profunctor.rmap(dictProfunctor)(sa)(g))(e));
            };
          };
        };
      };
    });
  };
};

var au = function au(l) {
  return withIso(l)(function (sa) {
    return function (bt) {
      return function (f) {
        return function (e) {
          return sa(f(bt)(e));
        };
      };
    };
  });
};

module.exports = {
  iso: iso,
  withIso: withIso,
  cloneIso: cloneIso,
  re: re,
  au: au,
  auf: auf,
  under: under,
  non: non,
  curried: curried,
  uncurried: uncurried,
  flipped: flipped,
  mapping: mapping,
  dimapping: dimapping
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Data.Boolean/index.js":"../output/Data.Boolean/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Lens.Internal.Exchange/index.js":"../output/Data.Lens.Internal.Exchange/index.js","../Data.Lens.Internal.Re/index.js":"../output/Data.Lens.Internal.Re/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/Data.Lens.Iso.Newtype/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Lens_Iso = require("../Data.Lens.Iso/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var _Newtype = function _Newtype(dictNewtype) {
  return function (dictNewtype1) {
    return function (dictProfunctor) {
      return Data_Lens_Iso.iso(Data_Newtype.unwrap(dictNewtype))(Data_Newtype.wrap(dictNewtype1))(dictProfunctor);
    };
  };
};

module.exports = {
  "_Newtype": _Newtype
};
},{"../Data.Lens.Iso/index.js":"../output/Data.Lens.Iso/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js"}],"../output/Data.Lens.Internal.Market/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Bifunctor = require("../Data.Bifunctor/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var Market = function () {
  function Market(value0, value1) {
    this.value0 = value0;
    this.value1 = value1;
  }

  ;

  Market.create = function (value0) {
    return function (value1) {
      return new Market(value0, value1);
    };
  };

  return Market;
}();

var profunctorMarket = new Data_Profunctor.Profunctor(function (f) {
  return function (g) {
    return function (v) {
      return new Market(function ($19) {
        return g(v.value0($19));
      }, function () {
        var $20 = Data_Bifunctor.lmap(Data_Either.bifunctorEither)(g);
        return function ($21) {
          return $20(v.value1(f($21)));
        };
      }());
    };
  };
});
var functorMarket = new Data_Functor.Functor(function (f) {
  return function (v) {
    return new Market(function ($22) {
      return f(v.value0($22));
    }, function () {
      var $23 = Data_Bifunctor.lmap(Data_Either.bifunctorEither)(f);
      return function ($24) {
        return $23(v.value1($24));
      };
    }());
  };
});
var choiceMarket = new Data_Profunctor_Choice.Choice(function () {
  return profunctorMarket;
}, function (v) {
  return new Market(function ($25) {
    return Data_Either.Left.create(v.value0($25));
  }, Data_Either.either(function () {
    var $26 = Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Either.Left.create);
    return function ($27) {
      return $26(v.value1($27));
    };
  }())(function ($28) {
    return Data_Either.Left.create(Data_Either.Right.create($28));
  }));
}, function (v) {
  return new Market(function ($29) {
    return Data_Either.Right.create(v.value0($29));
  }, Data_Either.either(function ($30) {
    return Data_Either.Left.create(Data_Either.Left.create($30));
  })(function () {
    var $31 = Data_Bifunctor.lmap(Data_Either.bifunctorEither)(Data_Either.Right.create);
    return function ($32) {
      return $31(v.value1($32));
    };
  }()));
});
module.exports = {
  Market: Market,
  functorMarket: functorMarket,
  profunctorMarket: profunctorMarket,
  choiceMarket: choiceMarket
};
},{"../Data.Bifunctor/index.js":"../output/Data.Bifunctor/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js"}],"../output/Data.Lens.Internal.Tagged/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Either = require("../Data.Either/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Ord = require("../Data.Ord/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var Data_Profunctor_Closed = require("../Data.Profunctor.Closed/index.js");

var Data_Profunctor_Costrong = require("../Data.Profunctor.Costrong/index.js");

var Data_Traversable = require("../Data.Traversable/index.js");

var Tagged = function Tagged(x) {
  return x;
};

var taggedProfunctor = new Data_Profunctor.Profunctor(function (v) {
  return function (g) {
    return function (v1) {
      return g(v1);
    };
  };
});
var taggedCostrong = new Data_Profunctor_Costrong.Costrong(function () {
  return taggedProfunctor;
}, function (v) {
  return v.value0;
}, function (v) {
  return v.value1;
});
var taggedClosed = new Data_Profunctor_Closed.Closed(function () {
  return taggedProfunctor;
}, function (v) {
  return Data_Function["const"](v);
});
var taggedChoice = new Data_Profunctor_Choice.Choice(function () {
  return taggedProfunctor;
}, function (v) {
  return new Data_Either.Left(v);
}, function (v) {
  return new Data_Either.Right(v);
});
var newtypeTagged = new Data_Newtype.Newtype(function (n) {
  return n;
}, Tagged);
var functorTagged = new Data_Functor.Functor(function (f) {
  return function (m) {
    return f(m);
  };
});
var foldableTagged = new Data_Foldable.Foldable(function (dictMonoid) {
  return function (f) {
    return function (v) {
      return f(v);
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return f(b)(v);
    };
  };
}, function (f) {
  return function (b) {
    return function (v) {
      return f(v)(b);
    };
  };
});
var traversableTagged = new Data_Traversable.Traversable(function () {
  return foldableTagged;
}, function () {
  return functorTagged;
}, function (dictApplicative) {
  return function (v) {
    return Data_Functor.map(dictApplicative.Apply0().Functor0())(Tagged)(v);
  };
}, function (dictApplicative) {
  return function (f) {
    return function (v) {
      return Data_Functor.map(dictApplicative.Apply0().Functor0())(Tagged)(f(v));
    };
  };
});

var eqTagged = function eqTagged(dictEq) {
  return new Data_Eq.Eq(function (x) {
    return function (y) {
      return Data_Eq.eq(dictEq)(x)(y);
    };
  });
};

var ordTagged = function ordTagged(dictOrd) {
  return new Data_Ord.Ord(function () {
    return eqTagged(dictOrd.Eq0());
  }, function (x) {
    return function (y) {
      return Data_Ord.compare(dictOrd)(x)(y);
    };
  });
};

var eq1Tagged = new Data_Eq.Eq1(function (dictEq) {
  return Data_Eq.eq(eqTagged(dictEq));
});
var ord1Tagged = new Data_Ord.Ord1(function () {
  return eq1Tagged;
}, function (dictOrd) {
  return Data_Ord.compare(ordTagged(dictOrd));
});
module.exports = {
  Tagged: Tagged,
  newtypeTagged: newtypeTagged,
  eqTagged: eqTagged,
  eq1Tagged: eq1Tagged,
  ordTagged: ordTagged,
  ord1Tagged: ord1Tagged,
  functorTagged: functorTagged,
  taggedProfunctor: taggedProfunctor,
  taggedChoice: taggedChoice,
  taggedCostrong: taggedCostrong,
  taggedClosed: taggedClosed,
  foldableTagged: foldableTagged,
  traversableTagged: traversableTagged
};
},{"../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Ord/index.js":"../output/Data.Ord/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js","../Data.Profunctor.Closed/index.js":"../output/Data.Profunctor.Closed/index.js","../Data.Profunctor.Costrong/index.js":"../output/Data.Profunctor.Costrong/index.js","../Data.Traversable/index.js":"../output/Data.Traversable/index.js"}],"../output/Data.Lens.Prism/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Control_Category = require("../Control.Category/index.js");

var Control_MonadZero = require("../Control.MonadZero/index.js");

var Data_Either = require("../Data.Either/index.js");

var Data_Eq = require("../Data.Eq/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_HeytingAlgebra = require("../Data.HeytingAlgebra/index.js");

var Data_Lens_Internal_Market = require("../Data.Lens.Internal.Market/index.js");

var Data_Lens_Internal_Tagged = require("../Data.Lens.Internal.Tagged/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Profunctor = require("../Data.Profunctor/index.js");

var Data_Profunctor_Choice = require("../Data.Profunctor.Choice/index.js");

var withPrism = function withPrism(l) {
  return function (f) {
    var v = l(new Data_Lens_Internal_Market.Market(Control_Category.identity(Control_Category.categoryFn), Data_Either.Right.create));
    return f(v.value0)(v.value1);
  };
};

var review = Data_Newtype.under(Data_Lens_Internal_Tagged.newtypeTagged)(Data_Lens_Internal_Tagged.newtypeTagged)(Data_Lens_Internal_Tagged.Tagged);

var prism = function prism(to) {
  return function (fro) {
    return function (dictChoice) {
      return function (pab) {
        return Data_Profunctor.dimap(dictChoice.Profunctor0())(fro)(Data_Either.either(Control_Category.identity(Control_Category.categoryFn))(Control_Category.identity(Control_Category.categoryFn)))(Data_Profunctor_Choice.right(dictChoice)(Data_Profunctor.rmap(dictChoice.Profunctor0())(to)(pab)));
      };
    };
  };
};

var prism$prime = function prism$prime(to) {
  return function (fro) {
    return function (dictChoice) {
      return prism(to)(function (s) {
        return Data_Maybe.maybe(new Data_Either.Left(s))(Data_Either.Right.create)(fro(s));
      })(dictChoice);
    };
  };
};

var nearly = function nearly(x) {
  return function (f) {
    return function (dictChoice) {
      return prism$prime(Data_Function["const"](x))(function () {
        var $14 = Control_MonadZero.guard(Data_Maybe.monadZeroMaybe);
        return function ($15) {
          return $14(f($15));
        };
      }())(dictChoice);
    };
  };
};

var only = function only(dictEq) {
  return function (x) {
    return function (dictChoice) {
      return nearly(x)(function (v) {
        return Data_Eq.eq(dictEq)(v)(x);
      })(dictChoice);
    };
  };
};

var matching = function matching(l) {
  return withPrism(l)(function (v) {
    return function (f) {
      return f;
    };
  });
};

var is = function is(dictHeytingAlgebra) {
  return function (l) {
    var $16 = Data_Either.either(Data_Function["const"](Data_HeytingAlgebra.ff(dictHeytingAlgebra)))(Data_Function["const"](Data_HeytingAlgebra.tt(dictHeytingAlgebra)));
    var $17 = matching(l);
    return function ($18) {
      return $16($17($18));
    };
  };
};

var isn$primet = function isn$primet(dictHeytingAlgebra) {
  return function (l) {
    var $19 = Data_HeytingAlgebra.not(dictHeytingAlgebra);
    var $20 = is(dictHeytingAlgebra)(l);
    return function ($21) {
      return $19($20($21));
    };
  };
};

var clonePrism = function clonePrism(l) {
  return function (dictChoice) {
    return withPrism(l)(function (x) {
      return function (y) {
        return function (p) {
          return prism(x)(y)(dictChoice)(p);
        };
      };
    });
  };
};

module.exports = {
  "prism'": prism$prime,
  prism: prism,
  only: only,
  nearly: nearly,
  review: review,
  is: is,
  "isn't": isn$primet,
  matching: matching,
  clonePrism: clonePrism,
  withPrism: withPrism
};
},{"../Control.Category/index.js":"../output/Control.Category/index.js","../Control.MonadZero/index.js":"../output/Control.MonadZero/index.js","../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Eq/index.js":"../output/Data.Eq/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.HeytingAlgebra/index.js":"../output/Data.HeytingAlgebra/index.js","../Data.Lens.Internal.Market/index.js":"../output/Data.Lens.Internal.Market/index.js","../Data.Lens.Internal.Tagged/index.js":"../output/Data.Lens.Internal.Tagged/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Profunctor/index.js":"../output/Data.Profunctor/index.js","../Data.Profunctor.Choice/index.js":"../output/Data.Profunctor.Choice/index.js"}],"../output/Data.Lens.Prism.Maybe/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Either = require("../Data.Either/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Lens_Prism = require("../Data.Lens.Prism/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var _Nothing = function _Nothing(dictChoice) {
  return Data_Lens_Prism.prism(Data_Function["const"](Data_Maybe.Nothing.value))(Data_Maybe.maybe(new Data_Either.Right(Data_Unit.unit))(Data_Function["const"](new Data_Either.Left(Data_Maybe.Nothing.value))))(dictChoice);
};

var _Just = function _Just(dictChoice) {
  return Data_Lens_Prism.prism(Data_Maybe.Just.create)(Data_Maybe.maybe(new Data_Either.Left(Data_Maybe.Nothing.value))(Data_Either.Right.create))(dictChoice);
};

module.exports = {
  "_Nothing": _Nothing,
  "_Just": _Just
};
},{"../Data.Either/index.js":"../output/Data.Either/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Lens.Prism/index.js":"../output/Data.Lens.Prism/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js"}],"../output/Data.Lens.Record/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Data_Function = require("../Data.Function/index.js");

var Data_Lens_Lens = require("../Data.Lens.Lens/index.js");

var Record = require("../Record/index.js");

var prop = function prop(dictIsSymbol) {
  return function (dictCons) {
    return function (dictCons1) {
      return function (l) {
        return function (dictStrong) {
          return Data_Lens_Lens.lens(Record.get(dictIsSymbol)()(l))(Data_Function.flip(Record.set(dictIsSymbol)()()(l)))(dictStrong);
        };
      };
    };
  };
};

module.exports = {
  prop: prop
};
},{"../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Lens.Lens/index.js":"../output/Data.Lens.Lens/index.js","../Record/index.js":"../output/Record/index.js"}],"../output/PureTabs.Model/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Browser_Tabs = require("../Browser.Tabs/index.js");

var Data_Functor = require("../Data.Functor/index.js");

var Data_Generic_Rep = require("../Data.Generic.Rep/index.js");

var Data_Generic_Rep_Show = require("../Data.Generic.Rep.Show/index.js");

var Data_Lens_At = require("../Data.Lens.At/index.js");

var Data_Lens_Getter = require("../Data.Lens.Getter/index.js");

var Data_Lens_Internal_Forget = require("../Data.Lens.Internal.Forget/index.js");

var Data_Lens_Iso_Newtype = require("../Data.Lens.Iso.Newtype/index.js");

var Data_Lens_Prism_Maybe = require("../Data.Lens.Prism.Maybe/index.js");

var Data_Lens_Record = require("../Data.Lens.Record/index.js");

var Data_List = require("../Data.List/index.js");

var Data_List_Types = require("../Data.List.Types/index.js");

var Data_Map_Internal = require("../Data.Map.Internal/index.js");

var Data_Maybe = require("../Data.Maybe/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Tuple = require("../Data.Tuple/index.js");

var SbTabDeleted = function () {
  function SbTabDeleted(value0) {
    this.value0 = value0;
  }

  ;

  SbTabDeleted.create = function (value0) {
    return new SbTabDeleted(value0);
  };

  return SbTabDeleted;
}();

var SbTabCreated = function () {
  function SbTabCreated() {}

  ;
  SbTabCreated.value = new SbTabCreated();
  return SbTabCreated;
}();

var SbTabMoved = function () {
  function SbTabMoved() {}

  ;
  SbTabMoved.value = new SbTabMoved();
  return SbTabMoved;
}();

var SbTabDetached = function () {
  function SbTabDetached() {}

  ;
  SbTabDetached.value = new SbTabDetached();
  return SbTabDetached;
}();

var SbGroupCreated = function () {
  function SbGroupCreated() {}

  ;
  SbGroupCreated.value = new SbGroupCreated();
  return SbGroupCreated;
}();

var SbGroupDeleted = function () {
  function SbGroupDeleted() {}

  ;
  SbGroupDeleted.value = new SbGroupDeleted();
  return SbGroupDeleted;
}();

var SbGroupRenamed = function () {
  function SbGroupRenamed() {}

  ;
  SbGroupRenamed.value = new SbGroupRenamed();
  return SbGroupRenamed;
}();

var SbHasWindowId = function () {
  function SbHasWindowId(value0) {
    this.value0 = value0;
  }

  ;

  SbHasWindowId.create = function (value0) {
    return new SbHasWindowId(value0);
  };

  return SbHasWindowId;
}();

var BgInitialTabList = function () {
  function BgInitialTabList(value0) {
    this.value0 = value0;
  }

  ;

  BgInitialTabList.create = function (value0) {
    return new BgInitialTabList(value0);
  };

  return BgInitialTabList;
}();

var BgTabCreated = function () {
  function BgTabCreated(value0) {
    this.value0 = value0;
  }

  ;

  BgTabCreated.create = function (value0) {
    return new BgTabCreated(value0);
  };

  return BgTabCreated;
}();

var BgTabDeleted = function () {
  function BgTabDeleted(value0) {
    this.value0 = value0;
  }

  ;

  BgTabDeleted.create = function (value0) {
    return new BgTabDeleted(value0);
  };

  return BgTabDeleted;
}();

var BgTabMoved = function () {
  function BgTabMoved() {}

  ;
  BgTabMoved.value = new BgTabMoved();
  return BgTabMoved;
}();

var BgTabActived = function () {
  function BgTabActived(value0) {
    this.value0 = value0;
  }

  ;

  BgTabActived.create = function (value0) {
    return new BgTabActived(value0);
  };

  return BgTabActived;
}();

var BgTabAttached = function () {
  function BgTabAttached(value0) {
    this.value0 = value0;
  }

  ;

  BgTabAttached.create = function (value0) {
    return new BgTabAttached(value0);
  };

  return BgTabAttached;
}();

var BgTabDetached = function () {
  function BgTabDetached(value0) {
    this.value0 = value0;
  }

  ;

  BgTabDetached.create = function (value0) {
    return new BgTabDetached(value0);
  };

  return BgTabDetached;
}();

var BgTabHighlighted = function () {
  function BgTabHighlighted() {}

  ;
  BgTabHighlighted.value = new BgTabHighlighted();
  return BgTabHighlighted;
}();

var BgTabReplaced = function () {
  function BgTabReplaced() {}

  ;
  BgTabReplaced.value = new BgTabReplaced();
  return BgTabReplaced;
}();

var BgTabZoomChanged = function () {
  function BgTabZoomChanged() {}

  ;
  BgTabZoomChanged.value = new BgTabZoomChanged();
  return BgTabZoomChanged;
}();

var initialGlobalState = {
  windows: Data_Map_Internal.empty
};
var genSidebarEvent = new Data_Generic_Rep.Generic(function (x) {
  if (x instanceof SbTabDeleted) {
    return new Data_Generic_Rep.Inl(x.value0);
  }

  ;

  if (x instanceof SbTabCreated) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value));
  }

  ;

  if (x instanceof SbTabMoved) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value)));
  }

  ;

  if (x instanceof SbTabDetached) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value))));
  }

  ;

  if (x instanceof SbGroupCreated) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value)))));
  }

  ;

  if (x instanceof SbGroupDeleted) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value))))));
  }

  ;

  if (x instanceof SbGroupRenamed) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value)))))));
  }

  ;

  if (x instanceof SbHasWindowId) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(x.value0)))))));
  }

  ;
  throw new Error("Failed pattern match at PureTabs.Model (line 141, column 1 - line 141, column 58): " + [x.constructor.name]);
}, function (x) {
  if (x instanceof Data_Generic_Rep.Inl) {
    return new SbTabDeleted(x.value0);
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inl) {
    return SbTabCreated.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return SbTabMoved.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return SbTabDetached.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return SbGroupCreated.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return SbGroupDeleted.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return SbGroupRenamed.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr) {
    return new SbHasWindowId(x.value0.value0.value0.value0.value0.value0.value0);
  }

  ;
  throw new Error("Failed pattern match at PureTabs.Model (line 141, column 1 - line 141, column 58): " + [x.constructor.name]);
});
var showSidebarEvent = new Data_Show.Show(Data_Generic_Rep_Show.genericShow(genSidebarEvent)(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Browser_Tabs.showTabId))(new Data_Symbol.IsSymbol(function () {
  return "SbTabDeleted";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "SbTabCreated";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "SbTabMoved";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "SbTabDetached";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "SbGroupCreated";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "SbGroupDeleted";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "SbGroupRenamed";
})))(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Browser_Tabs.showWindowId))(new Data_Symbol.IsSymbol(function () {
  return "SbHasWindowId";
})))))))))));
var genBackgroundEvent = new Data_Generic_Rep.Generic(function (x) {
  if (x instanceof BgInitialTabList) {
    return new Data_Generic_Rep.Inl(x.value0);
  }

  ;

  if (x instanceof BgTabCreated) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(x.value0));
  }

  ;

  if (x instanceof BgTabDeleted) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(x.value0)));
  }

  ;

  if (x instanceof BgTabMoved) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value))));
  }

  ;

  if (x instanceof BgTabActived) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(x.value0)))));
  }

  ;

  if (x instanceof BgTabAttached) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(x.value0))))));
  }

  ;

  if (x instanceof BgTabDetached) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(x.value0)))))));
  }

  ;

  if (x instanceof BgTabHighlighted) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value))))))));
  }

  ;

  if (x instanceof BgTabReplaced) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inl(Data_Generic_Rep.NoArguments.value)))))))));
  }

  ;

  if (x instanceof BgTabZoomChanged) {
    return new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(new Data_Generic_Rep.Inr(Data_Generic_Rep.NoArguments.value)))))))));
  }

  ;
  throw new Error("Failed pattern match at PureTabs.Model (line 126, column 1 - line 126, column 64): " + [x.constructor.name]);
}, function (x) {
  if (x instanceof Data_Generic_Rep.Inl) {
    return new BgInitialTabList(x.value0);
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inl) {
    return new BgTabCreated(x.value0.value0);
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return new BgTabDeleted(x.value0.value0.value0);
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return BgTabMoved.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return new BgTabActived(x.value0.value0.value0.value0.value0);
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return new BgTabAttached(x.value0.value0.value0.value0.value0.value0);
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return new BgTabDetached(x.value0.value0.value0.value0.value0.value0.value0);
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return BgTabHighlighted.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inl) {
    return BgTabReplaced.value;
  }

  ;

  if (x instanceof Data_Generic_Rep.Inr && x.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr && x.value0.value0.value0.value0.value0.value0.value0.value0 instanceof Data_Generic_Rep.Inr) {
    return BgTabZoomChanged.value;
  }

  ;
  throw new Error("Failed pattern match at PureTabs.Model (line 126, column 1 - line 126, column 64): " + [x.constructor.name]);
});
var showBackgroundEvent = new Data_Show.Show(Data_Generic_Rep_Show.genericShow(genBackgroundEvent)(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Data_Show.showArray(Browser_Tabs.showTab)))(new Data_Symbol.IsSymbol(function () {
  return "BgInitialTabList";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Browser_Tabs.showTab))(new Data_Symbol.IsSymbol(function () {
  return "BgTabCreated";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Browser_Tabs.showTabId))(new Data_Symbol.IsSymbol(function () {
  return "BgTabDeleted";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "BgTabMoved";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Browser_Tabs.showTabId))(new Data_Symbol.IsSymbol(function () {
  return "BgTabActived";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Browser_Tabs.showTab))(new Data_Symbol.IsSymbol(function () {
  return "BgTabAttached";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsArgument(Browser_Tabs.showTabId))(new Data_Symbol.IsSymbol(function () {
  return "BgTabDetached";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "BgTabHighlighted";
})))(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "BgTabReplaced";
})))(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsNoArguments)(new Data_Symbol.IsSymbol(function () {
  return "BgTabZoomChanged";
})))))))))))));

var _windows = function _windows(dictStrong) {
  return Data_Lens_Record.prop(new Data_Symbol.IsSymbol(function () {
    return "windows";
  }))()()(Data_Symbol.SProxy.value)(dictStrong);
};

var _windowId = function _windowId(dictStrong) {
  return Data_Lens_Record.prop(new Data_Symbol.IsSymbol(function () {
    return "windowId";
  }))()()(Data_Symbol.SProxy.value)(dictStrong);
};

var _title = function _title(dictStrong) {
  return Data_Lens_Record.prop(new Data_Symbol.IsSymbol(function () {
    return "title";
  }))()()(Data_Symbol.SProxy.value)(dictStrong);
};

var _tabs = function _tabs(dictStrong) {
  return Data_Lens_Record.prop(new Data_Symbol.IsSymbol(function () {
    return "tabs";
  }))()()(Data_Symbol.SProxy.value)(dictStrong);
};

var _tabWindowId = function _tabWindowId(dictStrong) {
  var $122 = Data_Lens_Iso_Newtype["_Newtype"](Browser_Tabs.newtypeTab)(Browser_Tabs.newtypeTab)(dictStrong.Profunctor0());

  var $123 = _windowId(dictStrong);

  return function ($124) {
    return $122($123($124));
  };
};

var _tabTitle = function _tabTitle(dictStrong) {
  var $125 = Data_Lens_Iso_Newtype["_Newtype"](Browser_Tabs.newtypeTab)(Browser_Tabs.newtypeTab)(dictStrong.Profunctor0());

  var $126 = _title(dictStrong);

  return function ($127) {
    return $125($126($127));
  };
};

var _tabFromWindow = function _tabFromWindow(tab$prime) {
  return function (dictWander) {
    var tab = Data_Newtype.unwrap(Browser_Tabs.newtypeTab)(tab$prime);

    var $128 = _windows(dictWander.Strong0());

    var $129 = Data_Lens_At.at(Data_Lens_At.atMap(Browser_Tabs.ordWindowId))(tab.windowId)(dictWander.Strong0());
    var $130 = Data_Lens_Prism_Maybe["_Just"](dictWander.Choice1());

    var $131 = _tabs(dictWander.Strong0());

    var $132 = Data_Lens_At.at(Data_Lens_At.atMap(Browser_Tabs.ordTabId))(tab.id)(dictWander.Strong0());
    return function ($133) {
      return $128($129($130($131($132($133)))));
    };
  };
};

var _tabFromTabIdAndWindow = function _tabFromTabIdAndWindow(s) {
  return function (tabId) {
    var allWindows = Data_Map_Internal.values(s.windows);
    var allTabs = Data_Functor.map(Data_List_Types.functorList)(Data_Lens_Getter.view(_tabs(Data_Lens_Internal_Forget.strongForget)))(allWindows);
    var matchingTabId = Data_Functor.map(Data_List_Types.functorList)(Data_Map_Internal.lookup(Browser_Tabs.ordTabId)(tabId))(allTabs);
    return Data_List.catMaybes(matchingTabId);
  };
};

var _port = function _port(dictStrong) {
  return Data_Lens_Record.prop(new Data_Symbol.IsSymbol(function () {
    return "port";
  }))()()(Data_Symbol.SProxy.value)(dictStrong);
};

var _portFromWindow = function _portFromWindow(tab$prime) {
  return function (dictWander) {
    var tab = Data_Newtype.unwrap(Browser_Tabs.newtypeTab)(tab$prime);

    var $134 = _windows(dictWander.Strong0());

    var $135 = Data_Lens_At.at(Data_Lens_At.atMap(Browser_Tabs.ordWindowId))(tab.windowId)(dictWander.Strong0());
    var $136 = Data_Lens_Prism_Maybe["_Just"](dictWander.Choice1());

    var $137 = _port(dictWander.Strong0());

    var $138 = Data_Lens_Prism_Maybe["_Just"](dictWander.Choice1());
    return function ($139) {
      return $134($135($136($137($138($139)))));
    };
  };
};

var _id = function _id(dictStrong) {
  return Data_Lens_Record.prop(new Data_Symbol.IsSymbol(function () {
    return "id";
  }))()()(Data_Symbol.SProxy.value)(dictStrong);
};

var _tabId = function _tabId(dictStrong) {
  var $140 = Data_Lens_Iso_Newtype["_Newtype"](Browser_Tabs.newtypeTab)(Browser_Tabs.newtypeTab)(dictStrong.Profunctor0());

  var $141 = _id(dictStrong);

  return function ($142) {
    return $140($141($142));
  };
};

var tabsToGlobalState = function tabsToGlobalState(tabs) {
  var tabsToWindows = function tabsToWindows(tabs$prime) {
    return Data_Map_Internal.fromFoldableWith(Browser_Tabs.ordWindowId)(Data_List_Types.foldableList)(function (v1) {
      return function (v2) {
        return {
          tabs: Data_Map_Internal.union(Browser_Tabs.ordTabId)(v1.tabs)(v2.tabs),
          port: Data_Maybe.Nothing.value
        };
      };
    })(Data_Functor.map(Data_List_Types.functorList)(function (t) {
      return new Data_Tuple.Tuple(Data_Lens_Getter.view(_tabWindowId(Data_Lens_Internal_Forget.strongForget))(t), {
        tabs: Data_Map_Internal.singleton(Data_Lens_Getter.view(_tabId(Data_Lens_Internal_Forget.strongForget))(t))(t),
        port: Data_Maybe.Nothing.value
      });
    })(tabs$prime));
  };

  return {
    windows: tabsToWindows(tabs)
  };
};

module.exports = {
  "_tabs": _tabs,
  "_port": _port,
  "_windows": _windows,
  "_portFromWindow": _portFromWindow,
  "_tabFromWindow": _tabFromWindow,
  "_tabWindowId": _tabWindowId,
  "_tabId": _tabId,
  "_tabFromTabIdAndWindow": _tabFromTabIdAndWindow,
  initialGlobalState: initialGlobalState,
  tabsToGlobalState: tabsToGlobalState,
  BgInitialTabList: BgInitialTabList,
  BgTabCreated: BgTabCreated,
  BgTabDeleted: BgTabDeleted,
  BgTabMoved: BgTabMoved,
  BgTabActived: BgTabActived,
  BgTabAttached: BgTabAttached,
  BgTabDetached: BgTabDetached,
  BgTabHighlighted: BgTabHighlighted,
  BgTabReplaced: BgTabReplaced,
  BgTabZoomChanged: BgTabZoomChanged,
  SbTabDeleted: SbTabDeleted,
  SbTabCreated: SbTabCreated,
  SbTabMoved: SbTabMoved,
  SbTabDetached: SbTabDetached,
  SbGroupCreated: SbGroupCreated,
  SbGroupDeleted: SbGroupDeleted,
  SbGroupRenamed: SbGroupRenamed,
  SbHasWindowId: SbHasWindowId,
  genBackgroundEvent: genBackgroundEvent,
  showBackgroundEvent: showBackgroundEvent,
  genSidebarEvent: genSidebarEvent,
  showSidebarEvent: showSidebarEvent
};
},{"../Browser.Tabs/index.js":"../output/Browser.Tabs/index.js","../Data.Functor/index.js":"../output/Data.Functor/index.js","../Data.Generic.Rep/index.js":"../output/Data.Generic.Rep/index.js","../Data.Generic.Rep.Show/index.js":"../output/Data.Generic.Rep.Show/index.js","../Data.Lens.At/index.js":"../output/Data.Lens.At/index.js","../Data.Lens.Getter/index.js":"../output/Data.Lens.Getter/index.js","../Data.Lens.Internal.Forget/index.js":"../output/Data.Lens.Internal.Forget/index.js","../Data.Lens.Iso.Newtype/index.js":"../output/Data.Lens.Iso.Newtype/index.js","../Data.Lens.Prism.Maybe/index.js":"../output/Data.Lens.Prism.Maybe/index.js","../Data.Lens.Record/index.js":"../output/Data.Lens.Record/index.js","../Data.List/index.js":"../output/Data.List/index.js","../Data.List.Types/index.js":"../output/Data.List.Types/index.js","../Data.Map.Internal/index.js":"../output/Data.Map.Internal/index.js","../Data.Maybe/index.js":"../output/Data.Maybe/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Tuple/index.js":"../output/Data.Tuple/index.js"}],"../output/PureTabs.Sidebar/index.js":[function(require,module,exports) {
// Generated by purs version 0.13.6
"use strict";

var Browser_Runtime = require("../Browser.Runtime/index.js");

var Browser_Tabs = require("../Browser.Tabs/index.js");

var Browser_Windows = require("../Browser.Windows/index.js");

var Control_Bind = require("../Control.Bind/index.js");

var Data_Foldable = require("../Data.Foldable/index.js");

var Data_Function = require("../Data.Function/index.js");

var Data_Newtype = require("../Data.Newtype/index.js");

var Data_Show = require("../Data.Show/index.js");

var Data_Symbol = require("../Data.Symbol/index.js");

var Data_Unit = require("../Data.Unit/index.js");

var Effect = require("../Effect/index.js");

var Effect_Aff = require("../Effect.Aff/index.js");

var Effect_Class = require("../Effect.Class/index.js");

var Effect_Console = require("../Effect.Console/index.js");

var Foreign_Generic_Class = require("../Foreign.Generic.Class/index.js");

var JQuery = require("../JQuery/index.js");

var PureTabs_Model = require("../PureTabs.Model/index.js");

var deleteTabElement = function deleteTabElement(tabId) {
  return function __do() {
    var div = JQuery.select("#" + Data_Show.show(Browser_Tabs.showTabId)(tabId))();
    return JQuery.remove(div)();
  };
};

var createTabElement = function createTabElement(tab$prime) {
  var tab = Data_Newtype.unwrap(Browser_Tabs.newtypeTab)(tab$prime);
  return function __do() {
    var tabDiv = JQuery.create("<div>")();
    JQuery.setText(tab.title)(tabDiv)();
    JQuery.setAttr("class")("tab")(tabDiv)();
    JQuery.setAttr("id")(tab.id)(tabDiv)();
    var favicon = JQuery.create("<span class=\"favicon\">")();
    var tabTitle = JQuery.create("<span class=\"tab-title\">")();
    JQuery.append(favicon)(tabDiv)();
    JQuery.append(tabTitle)(tabDiv)();
    return tabDiv;
  };
};

var initSidebar = function initSidebar(port) {
  return function (winId) {
    var onMsg = function onMsg(contentDiv) {
      return function (event) {
        if (event instanceof PureTabs_Model.BgTabCreated) {
          return function __do() {
            var tabElem = createTabElement(event.value0)();
            JQuery.append(tabElem)(contentDiv)();
            return Data_Unit.unit;
          };
        }

        ;

        if (event instanceof PureTabs_Model.BgTabDeleted) {
          return deleteTabElement(event.value0);
        }

        ;

        if (event instanceof PureTabs_Model.BgInitialTabList) {
          return Data_Foldable.traverse_(Effect.applicativeEffect)(Data_Foldable.foldableArray)(Control_Bind.composeKleisli(Effect.bindEffect)(createTabElement)(Data_Function.flip(JQuery.append)(contentDiv)))(event.value0);
        }

        ;
        return Effect_Console.log("received unsupported message type");
      };
    };

    return function __do() {
      Effect_Console.log("windowId " + Data_Show.show(Browser_Tabs.showWindowId)(winId))();
      Browser_Runtime.postMessageJson(PureTabs_Model.genSidebarEvent)(Foreign_Generic_Class.genericEncodeSum(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbTabDeleted";
      }))(Foreign_Generic_Class.genericEncodeArgsArgument(Foreign_Generic_Class.encodeWithOptionsOther(Browser_Tabs.encodeTabId))))(Foreign_Generic_Class.genericEncodeSum(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbTabCreated";
      }))(Foreign_Generic_Class.genericEncodeArgsNoArguments))(Foreign_Generic_Class.genericEncodeSum(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbTabMoved";
      }))(Foreign_Generic_Class.genericEncodeArgsNoArguments))(Foreign_Generic_Class.genericEncodeSum(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbTabDetached";
      }))(Foreign_Generic_Class.genericEncodeArgsNoArguments))(Foreign_Generic_Class.genericEncodeSum(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbGroupCreated";
      }))(Foreign_Generic_Class.genericEncodeArgsNoArguments))(Foreign_Generic_Class.genericEncodeSum(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbGroupDeleted";
      }))(Foreign_Generic_Class.genericEncodeArgsNoArguments))(Foreign_Generic_Class.genericEncodeSum(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbGroupRenamed";
      }))(Foreign_Generic_Class.genericEncodeArgsNoArguments))(Foreign_Generic_Class.genericEncodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "SbHasWindowId";
      }))(Foreign_Generic_Class.genericEncodeArgsArgument(Foreign_Generic_Class.encodeWithOptionsOther(Browser_Tabs.encodeWindowId)))))))))))(port)(new PureTabs_Model.SbHasWindowId(winId))();
      var tabsDiv = JQuery.select("#tabs")();
      Browser_Runtime.onMessageJsonAddListener(PureTabs_Model.genBackgroundEvent)(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgInitialTabList";
      }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Foreign_Generic_Class.arrayDecode(Browser_Tabs.decodeTab))))(Foreign_Generic_Class.genericCountArgsArgument))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabCreated";
      }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Browser_Tabs.decodeTab)))(Foreign_Generic_Class.genericCountArgsArgument))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabDeleted";
      }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Browser_Tabs.decodeTabId)))(Foreign_Generic_Class.genericCountArgsArgument))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabMoved";
      }))(Foreign_Generic_Class.genericDecodeArgsNoArguments)(Foreign_Generic_Class.genericCountArgsNoArguments))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabActived";
      }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Browser_Tabs.decodeTabId)))(Foreign_Generic_Class.genericCountArgsArgument))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabAttached";
      }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Browser_Tabs.decodeTab)))(Foreign_Generic_Class.genericCountArgsArgument))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabDetached";
      }))(Foreign_Generic_Class.genericDecodeArgsArgument(Foreign_Generic_Class.decodeWithOptionsOther(Browser_Tabs.decodeTabId)))(Foreign_Generic_Class.genericCountArgsArgument))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabHighlighted";
      }))(Foreign_Generic_Class.genericDecodeArgsNoArguments)(Foreign_Generic_Class.genericCountArgsNoArguments))(Foreign_Generic_Class.genericDecodeSum(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabReplaced";
      }))(Foreign_Generic_Class.genericDecodeArgsNoArguments)(Foreign_Generic_Class.genericCountArgsNoArguments))(Foreign_Generic_Class.genericDecodeConstructor(new Data_Symbol.IsSymbol(function () {
        return "BgTabZoomChanged";
      }))(Foreign_Generic_Class.genericDecodeArgsNoArguments)(Foreign_Generic_Class.genericCountArgsNoArguments)))))))))))(port)(onMsg(tabsDiv))();
      return Data_Unit.unit;
    };
  };
};

var main = function () {
  var runSidebar = function runSidebar(port) {
    return Control_Bind.bind(Effect_Aff.bindAff)(Browser_Windows.getCurrent)(function (currentWindow) {
      return Effect_Class.liftEffect(Effect_Aff.monadEffectAff)(initSidebar(port)(currentWindow.id));
    });
  };

  return function __do() {
    Effect_Console.log("started sidebar")();
    var port = Browser_Runtime.connect();
    return Effect_Aff.launchAff_(runSidebar(port))();
  };
}();

module.exports = {
  main: main,
  initSidebar: initSidebar,
  createTabElement: createTabElement,
  deleteTabElement: deleteTabElement
};
},{"../Browser.Runtime/index.js":"../output/Browser.Runtime/index.js","../Browser.Tabs/index.js":"../output/Browser.Tabs/index.js","../Browser.Windows/index.js":"../output/Browser.Windows/index.js","../Control.Bind/index.js":"../output/Control.Bind/index.js","../Data.Foldable/index.js":"../output/Data.Foldable/index.js","../Data.Function/index.js":"../output/Data.Function/index.js","../Data.Newtype/index.js":"../output/Data.Newtype/index.js","../Data.Show/index.js":"../output/Data.Show/index.js","../Data.Symbol/index.js":"../output/Data.Symbol/index.js","../Data.Unit/index.js":"../output/Data.Unit/index.js","../Effect/index.js":"../output/Effect/index.js","../Effect.Aff/index.js":"../output/Effect.Aff/index.js","../Effect.Class/index.js":"../output/Effect.Class/index.js","../Effect.Console/index.js":"../output/Effect.Console/index.js","../Foreign.Generic.Class/index.js":"../output/Foreign.Generic.Class/index.js","../JQuery/index.js":"../output/JQuery/index.js","../PureTabs.Model/index.js":"../output/PureTabs.Model/index.js"}],"sidebar.js":[function(require,module,exports) {
var Sidebar = require("../output/PureTabs.Sidebar");

function main() {
  Sidebar.main();
}

main();
},{"../output/PureTabs.Sidebar":"../output/PureTabs.Sidebar/index.js"}],"../node_modules/parcel/src/builtins/hmr-runtime.js":[function(require,module,exports) {
var global = arguments[3];
var OVERLAY_ID = '__parcel__error__overlay__';
var OldModule = module.bundle.Module;

function Module(moduleName) {
  OldModule.call(this, moduleName);
  this.hot = {
    data: module.bundle.hotData,
    _acceptCallbacks: [],
    _disposeCallbacks: [],
    accept: function (fn) {
      this._acceptCallbacks.push(fn || function () {});
    },
    dispose: function (fn) {
      this._disposeCallbacks.push(fn);
    }
  };
  module.bundle.hotData = null;
}

module.bundle.Module = Module;
var checkedAssets, assetsToAccept;
var parent = module.bundle.parent;

if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
  var hostname = "" || location.hostname;
  var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
  var ws = new WebSocket(protocol + '://' + hostname + ':' + "33577" + '/');

  ws.onmessage = function (event) {
    checkedAssets = {};
    assetsToAccept = [];
    var data = JSON.parse(event.data);

    if (data.type === 'update') {
      var handled = false;
      data.assets.forEach(function (asset) {
        if (!asset.isNew) {
          var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);

          if (didAccept) {
            handled = true;
          }
        }
      }); // Enable HMR for CSS by default.

      handled = handled || data.assets.every(function (asset) {
        return asset.type === 'css' && asset.generated.js;
      });

      if (handled) {
        console.clear();
        data.assets.forEach(function (asset) {
          hmrApply(global.parcelRequire, asset);
        });
        assetsToAccept.forEach(function (v) {
          hmrAcceptRun(v[0], v[1]);
        });
      } else if (location.reload) {
        // `location` global exists in a web worker context but lacks `.reload()` function.
        location.reload();
      }
    }

    if (data.type === 'reload') {
      ws.close();

      ws.onclose = function () {
        location.reload();
      };
    }

    if (data.type === 'error-resolved') {
      console.log('[parcel] ✨ Error resolved');
      removeErrorOverlay();
    }

    if (data.type === 'error') {
      console.error('[parcel] 🚨  ' + data.error.message + '\n' + data.error.stack);
      removeErrorOverlay();
      var overlay = createErrorOverlay(data);
      document.body.appendChild(overlay);
    }
  };
}

function removeErrorOverlay() {
  var overlay = document.getElementById(OVERLAY_ID);

  if (overlay) {
    overlay.remove();
  }
}

function createErrorOverlay(data) {
  var overlay = document.createElement('div');
  overlay.id = OVERLAY_ID; // html encode message and stack trace

  var message = document.createElement('div');
  var stackTrace = document.createElement('pre');
  message.innerText = data.error.message;
  stackTrace.innerText = data.error.stack;
  overlay.innerHTML = '<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;">' + '<span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span>' + '<span style="top: 2px; margin-left: 5px; position: relative;">🚨</span>' + '<div style="font-size: 18px; font-weight: bold; margin-top: 20px;">' + message.innerHTML + '</div>' + '<pre>' + stackTrace.innerHTML + '</pre>' + '</div>';
  return overlay;
}

function getParents(bundle, id) {
  var modules = bundle.modules;

  if (!modules) {
    return [];
  }

  var parents = [];
  var k, d, dep;

  for (k in modules) {
    for (d in modules[k][1]) {
      dep = modules[k][1][d];

      if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {
        parents.push(k);
      }
    }
  }

  if (bundle.parent) {
    parents = parents.concat(getParents(bundle.parent, id));
  }

  return parents;
}

function hmrApply(bundle, asset) {
  var modules = bundle.modules;

  if (!modules) {
    return;
  }

  if (modules[asset.id] || !bundle.parent) {
    var fn = new Function('require', 'module', 'exports', asset.generated.js);
    asset.isNew = !modules[asset.id];
    modules[asset.id] = [fn, asset.deps];
  } else if (bundle.parent) {
    hmrApply(bundle.parent, asset);
  }
}

function hmrAcceptCheck(bundle, id) {
  var modules = bundle.modules;

  if (!modules) {
    return;
  }

  if (!modules[id] && bundle.parent) {
    return hmrAcceptCheck(bundle.parent, id);
  }

  if (checkedAssets[id]) {
    return;
  }

  checkedAssets[id] = true;
  var cached = bundle.cache[id];
  assetsToAccept.push([bundle, id]);

  if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
    return true;
  }

  return getParents(global.parcelRequire, id).some(function (id) {
    return hmrAcceptCheck(global.parcelRequire, id);
  });
}

function hmrAcceptRun(bundle, id) {
  var cached = bundle.cache[id];
  bundle.hotData = {};

  if (cached) {
    cached.hot.data = bundle.hotData;
  }

  if (cached && cached.hot && cached.hot._disposeCallbacks.length) {
    cached.hot._disposeCallbacks.forEach(function (cb) {
      cb(bundle.hotData);
    });
  }

  delete bundle.cache[id];
  bundle(id);
  cached = bundle.cache[id];

  if (cached && cached.hot && cached.hot._acceptCallbacks.length) {
    cached.hot._acceptCallbacks.forEach(function (cb) {
      cb();
    });

    return true;
  }
}
},{}]},{},["../node_modules/parcel/src/builtins/hmr-runtime.js","sidebar.js"], null)
//# sourceMappingURL=/sidebar.js.map