import {
  none,
  some
} from "./chunk-WPJQNT3M.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/Witherable.ts
var Witherable_exports = {};
__export(Witherable_exports, {
  filterE: () => filterE,
  wiltDefault: () => wiltDefault,
  witherDefault: () => witherDefault
});
function wiltDefault(T, C) {
  return (F) => {
    const traverseF = T.traverse(F);
    return (wa, f) => F.map(traverseF(wa, f), C.separate);
  };
}
function witherDefault(T, C) {
  return (F) => {
    const traverseF = T.traverse(F);
    return (wa, f) => F.map(traverseF(wa, f), C.compact);
  };
}
function filterE(W) {
  return (F) => {
    const witherF = W.wither(F);
    return (predicate) => (ga) => witherF(ga, (a) => F.map(predicate(a), (b) => b ? some(a) : none));
  };
}

export {
  wiltDefault,
  witherDefault,
  filterE,
  Witherable_exports
};
