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




var _chunkWVUZCVAQjs = require('./chunk-WVUZCVAQ.js');






var _chunk5BEB3DGNjs = require('./chunk-5BEB3DGN.js');






var _chunk6UPN33ZOjs = require('./chunk-6UPN33ZO.js');



var _chunkVCW7SZ6Jjs = require('./chunk-VCW7SZ6J.js');








var _chunkY5WQY5GSjs = require('./chunk-Y5WQY5GS.js');



var _chunkDLEEPDK7js = require('./chunk-DLEEPDK7.js');


var _chunkS2Z5L3RBjs = require('./chunk-S2Z5L3RB.js');


var _chunkS3T27X3Ujs = require('./chunk-S3T27X3U.js');






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





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



var _chunkEBISTSVAjs = require('./chunk-EBISTSVA.js');








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






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


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

// src/ReaderTask.ts
var ReaderTask_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, ReaderTask_exports, {
  ApT: () => ApT,
  ApplicativePar: () => ApplicativePar,
  ApplicativeSeq: () => ApplicativeSeq,
  ApplyPar: () => ApplyPar2,
  ApplySeq: () => ApplySeq,
  Chain: () => Chain,
  ChainRec: () => ChainRec,
  Do: () => Do,
  FromIO: () => FromIO,
  FromReader: () => FromReader,
  FromTask: () => FromTask,
  Functor: () => Functor2,
  Monad: () => Monad2,
  MonadIO: () => MonadIO,
  MonadTask: () => MonadTask,
  Pointed: () => Pointed2,
  URI: () => URI,
  ap: () => ap2,
  apFirst: () => apFirst2,
  apS: () => apS2,
  apSW: () => apSW,
  apSecond: () => apSecond2,
  apW: () => apW,
  as: () => as2,
  asUnit: () => asUnit2,
  ask: () => ask2,
  asks: () => asks2,
  asksReaderTask: () => asksReaderTask,
  asksReaderTaskW: () => asksReaderTaskW,
  bind: () => bind2,
  bindTo: () => bindTo2,
  bindW: () => bindW,
  chain: () => chain,
  chainFirst: () => chainFirst,
  chainFirstIOK: () => chainFirstIOK,
  chainFirstReaderIOK: () => chainFirstReaderIOK,
  chainFirstReaderIOKW: () => chainFirstReaderIOKW,
  chainFirstReaderK: () => chainFirstReaderK,
  chainFirstReaderKW: () => chainFirstReaderKW,
  chainFirstTaskK: () => chainFirstTaskK,
  chainFirstW: () => chainFirstW,
  chainIOK: () => chainIOK,
  chainReaderIOK: () => chainReaderIOK,
  chainReaderIOKW: () => chainReaderIOKW,
  chainReaderK: () => chainReaderK,
  chainReaderKW: () => chainReaderKW,
  chainRec: () => chainRec,
  chainTaskK: () => chainTaskK,
  chainW: () => chainW,
  do: () => do_2,
  flap: () => flap2,
  flatMap: () => flatMap2,
  flatMapIO: () => flatMapIO2,
  flatMapReader: () => flatMapReader2,
  flatMapReaderIO: () => flatMapReaderIO,
  flatMapTask: () => flatMapTask2,
  flatten: () => flatten,
  flattenW: () => flattenW,
  fromIO: () => fromIO2,
  fromIOK: () => fromIOK2,
  fromReader: () => fromReader2,
  fromReaderIO: () => fromReaderIO,
  fromReaderIOK: () => fromReaderIOK,
  fromReaderK: () => fromReaderK2,
  fromTask: () => fromTask,
  fromTaskK: () => fromTaskK2,
  getMonoid: () => getMonoid,
  getSemigroup: () => getSemigroup,
  let: () => let_2,
  local: () => local2,
  map: () => map3,
  of: () => of3,
  readerTask: () => readerTask,
  readerTaskSeq: () => readerTaskSeq,
  run: () => run,
  sequenceArray: () => sequenceArray,
  sequenceSeqArray: () => sequenceSeqArray,
  tap: () => tap2,
  tapIO: () => tapIO2,
  tapReader: () => tapReader2,
  tapReaderIO: () => tapReaderIO,
  tapTask: () => tapTask2,
  traverseArray: () => traverseArray,
  traverseArrayWithIndex: () => traverseArrayWithIndex,
  traverseReadonlyArrayWithIndex: () => traverseReadonlyArrayWithIndex,
  traverseReadonlyArrayWithIndexSeq: () => traverseReadonlyArrayWithIndexSeq,
  traverseReadonlyNonEmptyArrayWithIndex: () => traverseReadonlyNonEmptyArrayWithIndex3,
  traverseReadonlyNonEmptyArrayWithIndexSeq: () => traverseReadonlyNonEmptyArrayWithIndexSeq2,
  traverseSeqArray: () => traverseSeqArray,
  traverseSeqArrayWithIndex: () => traverseSeqArrayWithIndex
});
var fromReader2 = /* @__PURE__ */ _chunk6UPN33ZOjs.fromReader.call(void 0, _chunkY5WQY5GSjs.Pointed);
var fromTask = _chunk5BEB3DGNjs.of;
var fromIO2 = /* @__PURE__ */ _chunkSQA7G4TEjs.flow.call(void 0, _chunkY5WQY5GSjs.fromIO, fromTask);
var fromReaderIO = _chunk5BEB3DGNjs.map.call(void 0, _chunkY5WQY5GSjs.fromIO);
var local2 = _chunk5BEB3DGNjs.local;
var asksReaderTaskW = _chunk5BEB3DGNjs.asksReaderW;
var asksReaderTask = asksReaderTaskW;
var _map = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, map3(f));
var _apPar = (fab, fa) => _chunkSQA7G4TEjs.pipe.call(void 0, fab, ap2(fa));
var _apSeq = (fab, fa) => flatMap2(fab, (f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, map3(f)));
var map3 = /* @__PURE__ */ _chunk6UPN33ZOjs.map.call(void 0, 
  _chunkY5WQY5GSjs.Functor
);
var ap2 = /* @__PURE__ */ _chunk6UPN33ZOjs.ap.call(void 0, _chunkY5WQY5GSjs.ApplyPar);
var apW = ap2;
var of3 = /* @__PURE__ */ _chunk6UPN33ZOjs.of.call(void 0, _chunkY5WQY5GSjs.Pointed);
var flatMap2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunk6UPN33ZOjs.flatMap.call(void 0, _chunkY5WQY5GSjs.Monad));
var flattenW = /* @__PURE__ */ flatMap2(_chunkSQA7G4TEjs.identity);
var flatten = flattenW;
var URI = "ReaderTask";
var Functor2 = {
  URI,
  map: _map
};
var as2 = _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunk7K74W2G3js.as.call(void 0, Functor2));
var asUnit2 = _chunk7K74W2G3js.asUnit.call(void 0, Functor2);
var flap2 = /* @__PURE__ */ _chunk7K74W2G3js.flap.call(void 0, Functor2);
var Pointed2 = {
  URI,
  of: of3
};
var ApplyPar2 = {
  URI,
  map: _map,
  ap: _apPar
};
var apFirst2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apFirst.call(void 0, ApplyPar2);
var apSecond2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apSecond.call(void 0, ApplyPar2);
var ApplicativePar = {
  URI,
  map: _map,
  ap: _apPar,
  of: of3
};
var ApplySeq = {
  URI,
  map: _map,
  ap: _apSeq
};
var ApplicativeSeq = {
  URI,
  map: _map,
  ap: _apSeq,
  of: of3
};
var Chain = {
  URI,
  map: _map,
  ap: _apPar,
  chain: flatMap2
};
var chainRec = (a, f) => (r) => async () => {
  let current = await f(a)(r)();
  while (_chunkOTKMOSH2js.isLeft.call(void 0, current)) {
    current = await f(current.left)(r)();
  }
  return current.right;
};
var ChainRec = {
  ...Chain,
  chainRec
};
var Monad2 = {
  URI,
  map: _map,
  of: of3,
  ap: _apPar,
  chain: flatMap2
};
var MonadIO = {
  URI,
  map: _map,
  of: of3,
  ap: _apPar,
  chain: flatMap2,
  fromIO: fromIO2
};
var MonadTask = {
  URI,
  map: _map,
  of: of3,
  ap: _apPar,
  chain: flatMap2,
  fromIO: fromIO2,
  fromTask
};
var FromIO = {
  URI,
  fromIO: fromIO2
};
var FromTask = {
  URI,
  fromIO: fromIO2,
  fromTask
};
var FromReader = {
  URI,
  fromReader: fromReader2
};
var _FlatMap = {
  flatMap: flatMap2
};
var _FromIO = {
  fromIO: FromIO.fromIO
};
var _FromTask = {
  fromTask
};
var _FromReader = {
  fromReader: fromReader2
};
var flatMapIO2 = _chunkOTKMOSH2js.flatMapIO.call(void 0, _FromIO, _FlatMap);
var flatMapTask2 = _chunkOTKMOSH2js.flatMapTask.call(void 0, _FromTask, _FlatMap);
var flatMapReader2 = _chunkOTKMOSH2js.flatMapReader.call(void 0, _FromReader, _FlatMap);
var flatMapReaderIO = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => flatMap2(self, fromReaderIOK(f))
);
var tap2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkEBISTSVAjs.tap.call(void 0, Chain));
var tapIO2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkDLEEPDK7js.tapIO.call(void 0, FromIO, Chain));
var tapReader2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkWVUZCVAQjs.tapReader.call(void 0, FromReader, Chain));
var tapTask2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkVCW7SZ6Jjs.tapTask.call(void 0, FromTask, Chain));
var tapReaderIO = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => tap2(self, fromReaderIOK(f))
);
var fromIOK2 = /* @__PURE__ */ _chunkDLEEPDK7js.fromIOK.call(void 0, FromIO);
var chainIOK = flatMapIO2;
var chainFirstIOK = tapIO2;
var ask2 = /* @__PURE__ */ _chunkWVUZCVAQjs.ask.call(void 0, FromReader);
var asks2 = /* @__PURE__ */ _chunkWVUZCVAQjs.asks.call(void 0, FromReader);
var fromReaderK2 = /* @__PURE__ */ _chunkWVUZCVAQjs.fromReaderK.call(void 0, FromReader);
var chainReaderK = flatMapReader2;
var chainReaderKW = flatMapReader2;
var chainFirstReaderK = tapReader2;
var chainFirstReaderKW = tapReader2;
var fromReaderIOK = (f) => (...a) => fromReaderIO(f(...a));
var chainReaderIOKW = flatMapReaderIO;
var chainReaderIOK = flatMapReaderIO;
var chainFirstReaderIOKW = tapReaderIO;
var chainFirstReaderIOK = tapReaderIO;
var fromTaskK2 = /* @__PURE__ */ _chunkVCW7SZ6Jjs.fromTaskK.call(void 0, FromTask);
var chainTaskK = flatMapTask2;
var chainFirstTaskK = tapTask2;
var Do = /* @__PURE__ */ of3(_chunkOTKMOSH2js.emptyRecord);
var bindTo2 = /* @__PURE__ */ _chunk7K74W2G3js.bindTo.call(void 0, Functor2);
var let_2 = /* @__PURE__ */ _chunk7K74W2G3js.let_.call(void 0, Functor2);
var bind2 = /* @__PURE__ */ _chunkEBISTSVAjs.bind.call(void 0, Chain);
var bindW = bind2;
var apS2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apS.call(void 0, ApplyPar2);
var apSW = apS2;
var ApT = /* @__PURE__ */ of3(_chunkOTKMOSH2js.emptyReadonlyArray);
var do_2 = _chunkS2Z5L3RBjs.do_3.call(void 0, 
  Pointed2,
  ChainRec
);
var traverseReadonlyNonEmptyArrayWithIndex3 = (f) => _chunkSQA7G4TEjs.flow.call(void 0, _chunk5BEB3DGNjs.traverseReadonlyNonEmptyArrayWithIndex.call(void 0, f), _chunk5BEB3DGNjs.map.call(void 0, _chunkY5WQY5GSjs.traverseReadonlyNonEmptyArrayWithIndex.call(void 0, _chunkSQA7G4TEjs.SK)));
var traverseReadonlyArrayWithIndex = (f) => {
  const g = traverseReadonlyNonEmptyArrayWithIndex3(f);
  return (as3) => _chunkOTKMOSH2js.isNonEmpty.call(void 0, as3) ? g(as3) : ApT;
};
var traverseReadonlyNonEmptyArrayWithIndexSeq2 = (f) => _chunkSQA7G4TEjs.flow.call(void 0, _chunk5BEB3DGNjs.traverseReadonlyNonEmptyArrayWithIndex.call(void 0, f), _chunk5BEB3DGNjs.map.call(void 0, _chunkY5WQY5GSjs.traverseReadonlyNonEmptyArrayWithIndexSeq.call(void 0, _chunkSQA7G4TEjs.SK)));
var traverseReadonlyArrayWithIndexSeq = (f) => {
  const g = traverseReadonlyNonEmptyArrayWithIndexSeq2(f);
  return (as3) => _chunkOTKMOSH2js.isNonEmpty.call(void 0, as3) ? g(as3) : ApT;
};
var traverseArrayWithIndex = traverseReadonlyArrayWithIndex;
var traverseArray = (f) => traverseReadonlyArrayWithIndex((_, a) => f(a));
var sequenceArray = /* @__PURE__ */ traverseArray(_chunkSQA7G4TEjs.identity);
var traverseSeqArrayWithIndex = traverseReadonlyArrayWithIndexSeq;
var traverseSeqArray = (f) => traverseReadonlyArrayWithIndexSeq((_, a) => f(a));
var chain = flatMap2;
var chainW = flatMap2;
var chainFirst = tap2;
var chainFirstW = tap2;
var sequenceSeqArray = /* @__PURE__ */ traverseSeqArray(_chunkSQA7G4TEjs.identity);
var readerTask = {
  URI,
  map: _map,
  of: of3,
  ap: _apPar,
  chain: flatMap2,
  fromIO: fromIO2,
  fromTask
};
var readerTaskSeq = {
  URI,
  map: _map,
  of: of3,
  ap: _apSeq,
  chain: flatMap2,
  fromIO: fromIO2,
  fromTask
};
var getSemigroup = /* @__PURE__ */ _chunkQ2LZCTWPjs.getApplySemigroup.call(void 0, ApplySeq);
var getMonoid = /* @__PURE__ */ _chunkS3T27X3Ujs.getApplicativeMonoid.call(void 0, ApplicativeSeq);
function run(ma, r) {
  return ma(r)();
}





























































































exports.fromReader = fromReader2; exports.fromTask = fromTask; exports.fromIO = fromIO2; exports.fromReaderIO = fromReaderIO; exports.local = local2; exports.asksReaderTaskW = asksReaderTaskW; exports.asksReaderTask = asksReaderTask; exports.map = map3; exports.ap = ap2; exports.apW = apW; exports.of = of3; exports.flatMap = flatMap2; exports.flattenW = flattenW; exports.flatten = flatten; exports.URI = URI; exports.Functor = Functor2; exports.as = as2; exports.asUnit = asUnit2; exports.flap = flap2; exports.Pointed = Pointed2; exports.ApplyPar = ApplyPar2; exports.apFirst = apFirst2; exports.apSecond = apSecond2; exports.ApplicativePar = ApplicativePar; exports.ApplySeq = ApplySeq; exports.ApplicativeSeq = ApplicativeSeq; exports.Chain = Chain; exports.chainRec = chainRec; exports.ChainRec = ChainRec; exports.Monad = Monad2; exports.MonadIO = MonadIO; exports.MonadTask = MonadTask; exports.FromIO = FromIO; exports.FromTask = FromTask; exports.FromReader = FromReader; exports.flatMapIO = flatMapIO2; exports.flatMapTask = flatMapTask2; exports.flatMapReader = flatMapReader2; exports.flatMapReaderIO = flatMapReaderIO; exports.tap = tap2; exports.tapIO = tapIO2; exports.tapReader = tapReader2; exports.tapTask = tapTask2; exports.tapReaderIO = tapReaderIO; exports.fromIOK = fromIOK2; exports.chainIOK = chainIOK; exports.chainFirstIOK = chainFirstIOK; exports.ask = ask2; exports.asks = asks2; exports.fromReaderK = fromReaderK2; exports.chainReaderK = chainReaderK; exports.chainReaderKW = chainReaderKW; exports.chainFirstReaderK = chainFirstReaderK; exports.chainFirstReaderKW = chainFirstReaderKW; exports.fromReaderIOK = fromReaderIOK; exports.chainReaderIOKW = chainReaderIOKW; exports.chainReaderIOK = chainReaderIOK; exports.chainFirstReaderIOKW = chainFirstReaderIOKW; exports.chainFirstReaderIOK = chainFirstReaderIOK; exports.fromTaskK = fromTaskK2; exports.chainTaskK = chainTaskK; exports.chainFirstTaskK = chainFirstTaskK; exports.Do = Do; exports.bindTo = bindTo2; exports.let_ = let_2; exports.bind = bind2; exports.bindW = bindW; exports.apS = apS2; exports.apSW = apSW; exports.ApT = ApT; exports.do_ = do_2; exports.traverseReadonlyNonEmptyArrayWithIndex = traverseReadonlyNonEmptyArrayWithIndex3; exports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex; exports.traverseReadonlyNonEmptyArrayWithIndexSeq = traverseReadonlyNonEmptyArrayWithIndexSeq2; exports.traverseReadonlyArrayWithIndexSeq = traverseReadonlyArrayWithIndexSeq; exports.traverseArrayWithIndex = traverseArrayWithIndex; exports.traverseArray = traverseArray; exports.sequenceArray = sequenceArray; exports.traverseSeqArrayWithIndex = traverseSeqArrayWithIndex; exports.traverseSeqArray = traverseSeqArray; exports.chain = chain; exports.chainW = chainW; exports.chainFirst = chainFirst; exports.chainFirstW = chainFirstW; exports.sequenceSeqArray = sequenceSeqArray; exports.readerTask = readerTask; exports.readerTaskSeq = readerTaskSeq; exports.getSemigroup = getSemigroup; exports.getMonoid = getMonoid; exports.run = run; exports.ReaderTask_exports = ReaderTask_exports;
