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

// src/FromIO.ts
var FromIO_exports = {};
__export(FromIO_exports, {
  chainFirstIOK: () => chainFirstIOK,
  chainIOK: () => chainIOK,
  fromIOK: () => fromIOK,
  tapIO: () => tapIO
});
function fromIOK(F) {
  return (f) => flow(f, F.fromIO);
}
function chainIOK(F, M) {
  return (f) => {
    const g = flow(f, F.fromIO);
    return (first) => M.chain(first, g);
  };
}
function chainFirstIOK(F, M) {
  const tapIOM = tapIO(F, M);
  return (f) => (first) => tapIOM(first, f);
}
function tapIO(F, M) {
  const chainFirstM = tap(M);
  return (self, f) => chainFirstM(self, flow(f, F.fromIO));
}

export {
  fromIOK,
  chainIOK,
  chainFirstIOK,
  tapIO,
  FromIO_exports
};
