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





var _chunkM3AZDBPNjs = require('./chunk-M3AZDBPN.js');





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






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






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



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


var _chunkS2Z5L3RBjs = require('./chunk-S2Z5L3RB.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/ReaderIO.ts
var ReaderIO_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, ReaderIO_exports, {
  ApT: () => ApT,
  Applicative: () => Applicative,
  Apply: () => Apply2,
  Chain: () => Chain,
  ChainRec: () => ChainRec,
  Do: () => Do,
  FromIO: () => FromIO,
  FromReader: () => FromReader,
  Functor: () => Functor2,
  Monad: () => Monad2,
  MonadIO: () => MonadIO,
  Pointed: () => Pointed2,
  URI: () => URI,
  ap: () => ap2,
  apFirst: () => apFirst2,
  apS: () => apS2,
  apSW: () => apSW,
  apSecond: () => apSecond2,
  apW: () => apW,
  as: () => as2,
  asUnit: () => asUnit2,
  ask: () => ask2,
  asks: () => asks2,
  asksReaderIO: () => asksReaderIO,
  asksReaderIOW: () => asksReaderIOW,
  bind: () => bind2,
  bindTo: () => bindTo2,
  bindW: () => bindW,
  chain: () => chain,
  chainFirst: () => chainFirst,
  chainFirstIOK: () => chainFirstIOK,
  chainFirstReaderK: () => chainFirstReaderK,
  chainFirstReaderKW: () => chainFirstReaderKW,
  chainFirstW: () => chainFirstW,
  chainIOK: () => chainIOK,
  chainReaderK: () => chainReaderK,
  chainReaderKW: () => chainReaderKW,
  chainRec: () => chainRec,
  chainW: () => chainW,
  do: () => do_2,
  flap: () => flap2,
  flatMap: () => flatMap2,
  flatMapIO: () => flatMapIO2,
  flatMapReader: () => flatMapReader2,
  flatten: () => flatten,
  flattenW: () => flattenW,
  fromIO: () => fromIO,
  fromIOK: () => fromIOK2,
  fromReader: () => fromReader2,
  fromReaderK: () => fromReaderK2,
  local: () => local2,
  map: () => map3,
  of: () => of3,
  sequenceArray: () => sequenceArray,
  tap: () => tap2,
  tapIO: () => tapIO2,
  tapReader: () => tapReader2,
  traverseArray: () => traverseArray,
  traverseArrayWithIndex: () => traverseArrayWithIndex,
  traverseReadonlyArrayWithIndex: () => traverseReadonlyArrayWithIndex,
  traverseReadonlyNonEmptyArrayWithIndex: () => traverseReadonlyNonEmptyArrayWithIndex3
});
var fromReader2 = /* @__PURE__ */ _chunk6UPN33ZOjs.fromReader.call(void 0, _chunkM3AZDBPNjs.Pointed);
var fromIO = _chunk5BEB3DGNjs.of;
var local2 = _chunk5BEB3DGNjs.local;
var asksReaderIOW = _chunk5BEB3DGNjs.asksReaderW;
var asksReaderIO = asksReaderIOW;
var _map = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, map3(f));
var _ap = (fab, fa) => _chunkSQA7G4TEjs.pipe.call(void 0, fab, ap2(fa));
var map3 = /* @__PURE__ */ _chunk6UPN33ZOjs.map.call(void 0, _chunkM3AZDBPNjs.Functor);
var ap2 = /* @__PURE__ */ _chunk6UPN33ZOjs.ap.call(void 0, _chunkM3AZDBPNjs.Apply);
var apW = ap2;
var of3 = /* @__PURE__ */ _chunk6UPN33ZOjs.of.call(void 0, _chunkM3AZDBPNjs.Pointed);
var flatMap2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunk6UPN33ZOjs.flatMap.call(void 0, _chunkM3AZDBPNjs.Monad));
var flattenW = /* @__PURE__ */ flatMap2(_chunkSQA7G4TEjs.identity);
var flatten = flattenW;
var URI = "ReaderIO";
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 Apply2 = {
  URI,
  map: _map,
  ap: _ap
};
var apFirst2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apFirst.call(void 0, Apply2);
var apSecond2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apSecond.call(void 0, Apply2);
var Applicative = {
  URI,
  map: _map,
  ap: _ap,
  of: of3
};
var Chain = {
  URI,
  map: _map,
  ap: _ap,
  chain: flatMap2
};
var chainRec = (a, f) => (r) => () => {
  let current = f(a)(r)();
  while (_chunkOTKMOSH2js.isLeft.call(void 0, current)) {
    current = f(current.left)(r)();
  }
  return current.right;
};
var ChainRec = {
  ...Chain,
  chainRec
};
var Monad2 = {
  URI,
  map: _map,
  of: of3,
  ap: _ap,
  chain: flatMap2
};
var MonadIO = {
  URI,
  map: _map,
  of: of3,
  ap: _ap,
  chain: flatMap2,
  fromIO
};
var FromIO = {
  URI,
  fromIO
};
var FromReader = {
  URI,
  fromReader: fromReader2
};
var _FlatMap = {
  flatMap: flatMap2
};
var _FromIO = {
  fromIO: FromIO.fromIO
};
var _FromReader = {
  fromReader: fromReader2
};
var flatMapIO2 = _chunkOTKMOSH2js.flatMapIO.call(void 0, _FromIO, _FlatMap);
var flatMapReader2 = /* @__PURE__ */ _chunkOTKMOSH2js.flatMapReader.call(void 0, _FromReader, _FlatMap);
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 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 Do = /* @__PURE__ */ of3(_chunkOTKMOSH2js.emptyRecord);
var bindTo2 = /* @__PURE__ */ _chunk7K74W2G3js.bindTo.call(void 0, Functor2);
var bind2 = /* @__PURE__ */ _chunkEBISTSVAjs.bind.call(void 0, Chain);
var bindW = bind2;
var apS2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apS.call(void 0, Apply2);
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, _chunkM3AZDBPNjs.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 traverseArrayWithIndex = traverseReadonlyArrayWithIndex;
var traverseArray = (f) => traverseReadonlyArrayWithIndex((_, a) => f(a));
var sequenceArray = /* @__PURE__ */ traverseArray(_chunkSQA7G4TEjs.identity);
var chain = flatMap2;
var chainW = flatMap2;
var chainFirst = tap2;
var chainFirstW = tap2;
































































exports.fromReader = fromReader2; exports.fromIO = fromIO; exports.local = local2; exports.asksReaderIOW = asksReaderIOW; exports.asksReaderIO = asksReaderIO; 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.Apply = Apply2; exports.apFirst = apFirst2; exports.apSecond = apSecond2; exports.Applicative = Applicative; exports.Chain = Chain; exports.chainRec = chainRec; exports.ChainRec = ChainRec; exports.Monad = Monad2; exports.MonadIO = MonadIO; exports.FromIO = FromIO; exports.FromReader = FromReader; exports.flatMapIO = flatMapIO2; exports.flatMapReader = flatMapReader2; exports.tap = tap2; exports.tapIO = tapIO2; exports.tapReader = tapReader2; 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.Do = Do; exports.bindTo = bindTo2; 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.traverseArrayWithIndex = traverseArrayWithIndex; exports.traverseArray = traverseArray; exports.sequenceArray = sequenceArray; exports.chain = chain; exports.chainW = chainW; exports.chainFirst = chainFirst; exports.chainFirstW = chainFirstW; exports.ReaderIO_exports = ReaderIO_exports;
