"use strict";Object.defineProperty(exports, "__esModule", {value: true});


var _chunkWM6CXSXAjs = require('./chunk-WM6CXSXA.js');



var _chunkQC33EBBCjs = require('./chunk-QC33EBBC.js');


var _chunkOTKMOSH2js = require('./chunk-OTKMOSH2.js');



var _chunkSQA7G4TEjs = require('./chunk-SQA7G4TE.js');


var _chunk6C3VEZWHjs = require('./chunk-6C3VEZWH.js');

// src/Semigroup.ts
var Semigroup_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, Semigroup_exports, {
  concatAll: () => concatAll2,
  constant: () => constant,
  first: () => first,
  fold: () => fold,
  getDualSemigroup: () => getDualSemigroup,
  getFirstSemigroup: () => getFirstSemigroup,
  getFunctionSemigroup: () => getFunctionSemigroup,
  getIntercalateSemigroup: () => getIntercalateSemigroup,
  getJoinSemigroup: () => getJoinSemigroup,
  getLastSemigroup: () => getLastSemigroup,
  getMeetSemigroup: () => getMeetSemigroup,
  getObjectSemigroup: () => getObjectSemigroup,
  getStructSemigroup: () => getStructSemigroup,
  getTupleSemigroup: () => getTupleSemigroup,
  intercalate: () => intercalate,
  last: () => last,
  max: () => max2,
  min: () => min2,
  reverse: () => reverse2,
  semigroupAll: () => semigroupAll,
  semigroupAny: () => semigroupAny,
  semigroupProduct: () => semigroupProduct,
  semigroupString: () => semigroupString,
  semigroupSum: () => semigroupSum,
  semigroupVoid: () => semigroupVoid,
  struct: () => struct,
  tuple: () => tuple
});
var min2 = (O) => ({
  concat: _chunkQC33EBBCjs.min.call(void 0, O)
});
var max2 = (O) => ({
  concat: _chunkQC33EBBCjs.max.call(void 0, O)
});
var constant = (a) => ({
  concat: () => a
});
var reverse2 = _chunkWM6CXSXAjs.reverse;
var struct = (semigroups) => ({
  concat: (first2, second) => {
    const r = {};
    for (const k in semigroups) {
      if (_chunkOTKMOSH2js.has.call(semigroups, k)) {
        r[k] = semigroups[k].concat(first2[k], second[k]);
      }
    }
    return r;
  }
});
var tuple = (...semigroups) => ({
  concat: (first2, second) => semigroups.map((s, i) => s.concat(first2[i], second[i]))
});
var intercalate = (middle) => (S) => ({
  concat: (x, y) => S.concat(x, S.concat(middle, y))
});
var first = () => ({ concat: _chunkSQA7G4TEjs.identity });
var last = () => ({ concat: (_, y) => y });
var concatAll2 = _chunkWM6CXSXAjs.concatAll;
var semigroupVoid = constant(void 0);
var getObjectSemigroup = () => ({
  concat: (first2, second) => Object.assign({}, first2, second)
});
var getLastSemigroup = last;
var getFirstSemigroup = first;
var getTupleSemigroup = tuple;
var getStructSemigroup = struct;
var getDualSemigroup = reverse2;
var getJoinSemigroup = max2;
var getMeetSemigroup = min2;
var getIntercalateSemigroup = intercalate;
function fold(S) {
  const concatAllS = concatAll2(S);
  return (startWith, as) => as === void 0 ? concatAllS(startWith) : concatAllS(startWith)(as);
}
var semigroupAll = {
  concat: (x, y) => x && y
};
var semigroupAny = {
  concat: (x, y) => x || y
};
var getFunctionSemigroup = _chunkSQA7G4TEjs.getSemigroup;
var semigroupString = {
  concat: (x, y) => x + y
};
var semigroupSum = {
  concat: (x, y) => x + y
};
var semigroupProduct = {
  concat: (x, y) => x * y
};






























exports.min = min2; exports.max = max2; exports.constant = constant; exports.reverse = reverse2; exports.struct = struct; exports.tuple = tuple; exports.intercalate = intercalate; exports.first = first; exports.last = last; exports.concatAll = concatAll2; exports.semigroupVoid = semigroupVoid; exports.getObjectSemigroup = getObjectSemigroup; exports.getLastSemigroup = getLastSemigroup; exports.getFirstSemigroup = getFirstSemigroup; exports.getTupleSemigroup = getTupleSemigroup; exports.getStructSemigroup = getStructSemigroup; exports.getDualSemigroup = getDualSemigroup; exports.getJoinSemigroup = getJoinSemigroup; exports.getMeetSemigroup = getMeetSemigroup; exports.getIntercalateSemigroup = getIntercalateSemigroup; exports.fold = fold; exports.semigroupAll = semigroupAll; exports.semigroupAny = semigroupAny; exports.getFunctionSemigroup = getFunctionSemigroup; exports.semigroupString = semigroupString; exports.semigroupSum = semigroupSum; exports.semigroupProduct = semigroupProduct; exports.Semigroup_exports = Semigroup_exports;
