import {
  getLeft,
  getRight
} from "./chunk-3AL4EMTU.mjs";
import {
  separated
} from "./chunk-RAKKSTP2.mjs";
import {
  getFunctorComposition,
  map
} from "./chunk-WKK6AYQI.mjs";
import {
  pipe
} from "./chunk-ZI34HWXZ.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/Compactable.ts
var Compactable_exports = {};
__export(Compactable_exports, {
  compact: () => compact,
  getCompactableComposition: () => getCompactableComposition,
  separate: () => separate
});
function compact(F, G) {
  return (fga) => F.map(fga, G.compact);
}
function separate(F, C, G) {
  const _compact = compact(F, C);
  const _map = map(F, G);
  return (fge) => separated(_compact(pipe(fge, _map(getLeft))), _compact(pipe(fge, _map(getRight))));
}
function getCompactableComposition(F, G) {
  const map2 = getFunctorComposition(F, G).map;
  return {
    map: map2,
    compact: compact(F, G),
    separate: separate(F, G, G)
  };
}

export {
  compact,
  separate,
  getCompactableComposition,
  Compactable_exports
};
