// Generated by purs version 0.13.6 "use strict"; var Data_Foldable = require("../Data.Foldable/index.js"); var Data_FunctorWithIndex = require("../Data.FunctorWithIndex/index.js"); var Data_Monoid = require("../Data.Monoid/index.js"); var Data_Semigroup = require("../Data.Semigroup/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 (Foldable0, foldMapWithIndex, foldlWithIndex, foldrWithIndex) { this.Foldable0 = Foldable0; this.foldMapWithIndex = foldMapWithIndex; this.foldlWithIndex = foldlWithIndex; this.foldrWithIndex = foldrWithIndex; }; var foldrWithIndex = function (dict) { return dict.foldrWithIndex; }; var foldMapWithIndexDefaultR = function (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 ($dollar__unused) { return Data_Foldable.foldableArray; }, function (dictMonoid) { return foldMapWithIndexDefaultR(foldableWithIndexArray)(dictMonoid); }, function (f) { return function (z) { var $166 = Data_Foldable.foldl(Data_Foldable.foldableArray)(function (y) { return function (v) { return f(v.value0)(y)(v.value1); }; })(z); var $167 = Data_FunctorWithIndex.mapWithIndex(Data_FunctorWithIndex.functorWithIndexArray)(Tuple.create); return function ($168) { return $166($167($168)); }; }; }, function (f) { return function (z) { var $169 = Data_Foldable.foldr(Data_Foldable.foldableArray)(function (v) { return function (y) { return f(v.value0)(v.value1)(y); }; })(z); var $170 = Data_FunctorWithIndex.mapWithIndex(Data_FunctorWithIndex.functorWithIndexArray)(Tuple.create); return function ($171) { return $169($170($171)); }; }; }); module.exports = { FoldableWithIndex: FoldableWithIndex, foldrWithIndex: foldrWithIndex, foldMapWithIndexDefaultR: foldMapWithIndexDefaultR, foldableWithIndexArray: foldableWithIndexArray };