import {
  ask
} from "./chunk-AHSGWEN4.mjs";
import {
  tap
} from "./chunk-MDNVYLGG.mjs";
import {
  flow
} from "./chunk-ZI34HWXZ.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/FromReader.ts
var FromReader_exports = {};
__export(FromReader_exports, {
  ask: () => ask2,
  asks: () => asks,
  chainFirstReaderK: () => chainFirstReaderK,
  chainReaderK: () => chainReaderK,
  fromReaderK: () => fromReaderK,
  tapReader: () => tapReader
});
function ask2(F) {
  return () => F.fromReader(ask());
}
function asks(F) {
  return F.fromReader;
}
function fromReaderK(F) {
  return (f) => flow(f, F.fromReader);
}
function chainReaderK(F, M) {
  const fromReaderKF = fromReaderK(F);
  return (f) => (ma) => M.chain(ma, fromReaderKF(f));
}
function chainFirstReaderK(F, M) {
  const tapM = tapReader(F, M);
  return (f) => (self) => tapM(self, f);
}
function tapReader(F, M) {
  const tapM = tap(M);
  return (self, f) => tapM(self, flow(f, F.fromReader));
}

export {
  ask2 as ask,
  asks,
  fromReaderK,
  chainReaderK,
  chainFirstReaderK,
  tapReader,
  FromReader_exports
};
