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










var _chunkE5IERNNKjs = require('./chunk-E5IERNNK.js');


var _chunk7K74W2G3js = require('./chunk-7K74W2G3.js');


var _chunkQ2LZCTWPjs = require('./chunk-Q2LZCTWP.js');



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


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

// src/TheseT.ts
var TheseT_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, TheseT_exports, {
  ap: () => ap2,
  bimap: () => bimap2,
  both: () => both2,
  chain: () => chain,
  getTheseM: () => getTheseM,
  left: () => left2,
  leftF: () => leftF,
  map: () => map2,
  mapLeft: () => mapLeft2,
  match: () => match2,
  matchE: () => matchE,
  right: () => right2,
  rightF: () => rightF,
  swap: () => swap2,
  toTuple2: () => toTuple22
});
function right2(F) {
  return _chunkSQA7G4TEjs.flow.call(void 0, _chunkE5IERNNKjs.right, F.of);
}
function left2(F) {
  return _chunkSQA7G4TEjs.flow.call(void 0, _chunkE5IERNNKjs.left, F.of);
}
function both2(F) {
  return _chunkSQA7G4TEjs.flow.call(void 0, _chunkE5IERNNKjs.both, F.of);
}
function rightF(F) {
  return (fa) => F.map(fa, _chunkE5IERNNKjs.right);
}
function leftF(F) {
  return (fe) => F.map(fe, _chunkE5IERNNKjs.left);
}
function map2(F) {
  return _chunk7K74W2G3js.map.call(void 0, F, _chunkE5IERNNKjs.Functor);
}
function ap2(F, S) {
  return _chunkQ2LZCTWPjs.ap.call(void 0, F, _chunkE5IERNNKjs.getApply.call(void 0, S));
}
function chain(M, S) {
  const _left = left2(M);
  return (f) => (ma) => M.chain(
    ma,
    _chunkE5IERNNKjs.match.call(void 0, 
      _left,
      f,
      (e1, a) => M.map(
        f(a),
        _chunkE5IERNNKjs.match.call(void 0, 
          (e2) => _chunkE5IERNNKjs.left.call(void 0, S.concat(e1, e2)),
          (b) => _chunkE5IERNNKjs.both.call(void 0, e1, b),
          (e2, b) => _chunkE5IERNNKjs.both.call(void 0, S.concat(e1, e2), b)
        )
      )
    )
  );
}
function bimap2(F) {
  return (f, g) => (fea) => F.map(fea, _chunkE5IERNNKjs.bimap.call(void 0, f, g));
}
function mapLeft2(F) {
  return (f) => (fea) => F.map(fea, _chunkE5IERNNKjs.mapLeft.call(void 0, f));
}
function match2(F) {
  return (onLeft, onRight, onBoth) => (ma) => F.map(ma, _chunkE5IERNNKjs.match.call(void 0, onLeft, onRight, onBoth));
}
function matchE(M) {
  return (onLeft, onRight, onBoth) => (ma) => M.chain(ma, _chunkE5IERNNKjs.match.call(void 0, onLeft, onRight, onBoth));
}
function swap2(F) {
  return (ma) => F.map(ma, _chunkE5IERNNKjs.swap);
}
function toTuple22(F) {
  return (e, a) => (fa) => F.map(fa, _chunkE5IERNNKjs.toTuple2.call(void 0, e, a));
}
function getTheseM(M) {
  const _map = map2(M);
  const _bimap = bimap2(M);
  const _mapLeft = mapLeft2(M);
  const _fold = matchE(M);
  const _toTuple2 = toTuple22(
    M
  );
  const of = right2(M);
  const mapT = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, _map(f));
  return {
    map: mapT,
    bimap: (fea, f, g) => _chunkSQA7G4TEjs.pipe.call(void 0, fea, _bimap(f, g)),
    mapLeft: (fea, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fea, _mapLeft(f)),
    fold: (fa, onLeft, onRight, onBoth) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, _fold(onLeft, onRight, onBoth)),
    swap: swap2(M),
    rightM: rightF(M),
    leftM: leftF(M),
    left: left2(M),
    right: right2(M),
    both: both2(M),
    toTuple: (fa, e, a) => _chunkSQA7G4TEjs.pipe.call(void 0, 
      fa,
      _toTuple2(
        () => e,
        () => a
      )
    ),
    getMonad: (S) => {
      const _ap = ap2(M, S);
      const _chain = chain(M, S);
      return {
        _E: void 0,
        map: mapT,
        of,
        ap: (fab, fa) => _chunkSQA7G4TEjs.pipe.call(void 0, fab, _ap(fa)),
        chain: (ma, f) => _chunkSQA7G4TEjs.pipe.call(void 0, ma, _chain(f))
      };
    }
  };
}


















exports.right = right2; exports.left = left2; exports.both = both2; exports.rightF = rightF; exports.leftF = leftF; exports.map = map2; exports.ap = ap2; exports.chain = chain; exports.bimap = bimap2; exports.mapLeft = mapLeft2; exports.match = match2; exports.matchE = matchE; exports.swap = swap2; exports.toTuple2 = toTuple22; exports.getTheseM = getTheseM; exports.TheseT_exports = TheseT_exports;
