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

// src/FromTask.ts
var FromTask_exports = {};
__export(FromTask_exports, {
  chainFirstTaskK: () => chainFirstTaskK,
  chainTaskK: () => chainTaskK,
  fromTaskK: () => fromTaskK,
  tapTask: () => tapTask
});
function fromTaskK(F) {
  return (f) => flow(f, F.fromTask);
}
function chainTaskK(F, M) {
  return (f) => {
    const g = flow(f, F.fromTask);
    return (first) => M.chain(first, g);
  };
}
function chainFirstTaskK(F, M) {
  const tapTaskM = tapTask(F, M);
  return (f) => (first) => tapTaskM(first, f);
}
function tapTask(F, M) {
  const tapM = tap(M);
  return (self, f) => tapM(self, flow(f, F.fromTask));
}

export {
  fromTaskK,
  chainTaskK,
  chainFirstTaskK,
  tapTask,
  FromTask_exports
};
