import { getInitializableAny } from "https://deno.land/x/fun@v2.0.0-alpha.12/predicate.ts";
Get a Initializable<Predicate> for any type A that combines using the Predicate or function.
Examples
Example 1
Example 1
import { getInitializableAny } from "./predicate.ts";
import { pipe } from "./fn.ts";
const { combine } = getInitializableAny<number>();
const lessThanZero = (n: number) => n < 0;
const greaterThanFifty = (n: number) => n > 50;
const notBetweenZeroAndFifty = pipe(
lessThanZero,
combine(greaterThanFifty),
);
const result1 = notBetweenZeroAndFifty(10); // false
const result2 = notBetweenZeroAndFifty(-10); // true
const result3 = notBetweenZeroAndFifty(100); // true