import {
  isRight,
  isSome
} from "./chunk-WPJQNT3M.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/Refinement.ts
var Refinement_exports = {};
__export(Refinement_exports, {
  and: () => and,
  compose: () => compose,
  fromEitherK: () => fromEitherK,
  fromOptionK: () => fromOptionK,
  id: () => id,
  not: () => not,
  or: () => or,
  zero: () => zero
});
var fromOptionK = (getOption) => {
  return (a) => isSome(getOption(a));
};
var fromEitherK = (getEither) => {
  return (a) => isRight(getEither(a));
};
var id = () => {
  return (_) => true;
};
var not = (refinement) => (a) => !refinement(a);
var or = (second) => (first) => (a) => first(a) || second(a);
var and = (second) => (first) => (a) => first(a) && second(a);
var zero = () => {
  return (_) => false;
};
var compose = (bc) => (ab) => {
  return (i) => ab(i) && bc(i);
};

export {
  fromOptionK,
  fromEitherK,
  id,
  not,
  or,
  and,
  zero,
  compose,
  Refinement_exports
};
