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