import {
  constFalse,
  constTrue,
  flow,
  pipe
} from "./chunk-ZI34HWXZ.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/Predicate.ts
var Predicate_exports = {};
__export(Predicate_exports, {
  Contravariant: () => Contravariant,
  URI: () => URI,
  and: () => and,
  contramap: () => contramap,
  getMonoidAll: () => getMonoidAll,
  getMonoidAny: () => getMonoidAny,
  getSemigroupAll: () => getSemigroupAll,
  getSemigroupAny: () => getSemigroupAny,
  not: () => not,
  or: () => or
});
var contramap_ = (predicate, f) => pipe(predicate, contramap(f));
var contramap = (f) => (predicate) => flow(f, predicate);
var URI = "Predicate";
var getSemigroupAny = () => ({
  concat: (first, second) => pipe(first, or(second))
});
var getMonoidAny = () => ({
  concat: getSemigroupAny().concat,
  empty: constFalse
});
var getSemigroupAll = () => ({
  concat: (first, second) => pipe(first, and(second))
});
var getMonoidAll = () => ({
  concat: getSemigroupAll().concat,
  empty: constTrue
});
var Contravariant = {
  URI,
  contramap: contramap_
};
var not = (predicate) => (a) => !predicate(a);
var or = (second) => (first) => (a) => first(a) || second(a);
var and = (second) => (first) => (a) => first(a) && second(a);

export {
  contramap,
  URI,
  getSemigroupAny,
  getMonoidAny,
  getSemigroupAll,
  getMonoidAll,
  Contravariant,
  not,
  or,
  and,
  Predicate_exports
};
