import {
  identity
} from "./chunk-ZI34HWXZ.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/Choice.ts
var Choice_exports = {};
__export(Choice_exports, {
  fanIn: () => fanIn,
  fanin: () => fanin,
  split: () => split,
  splitChoice: () => splitChoice
});
function split(P, C) {
  return (pab, pcd) => C.compose(P.right(pcd), P.left(pab));
}
function fanIn(P, C) {
  const splitPC = split(P, C);
  return (pac, pbc) => C.compose(
    P.promap(C.id(), (cc) => cc._tag === "Left" ? cc.left : cc.right, identity),
    splitPC(pac, pbc)
  );
}
function splitChoice(F) {
  return split(F, F);
}
function fanin(F) {
  return fanIn(F, F);
}

export {
  split,
  fanIn,
  splitChoice,
  fanin,
  Choice_exports
};
