import { partition } from "https://deno.land/x/fun@v.2.0.0-alpha.11/set.ts";
Given a Predicate or Refinement over A and a ReadonlySet return a Pair with a first value being a ReadonlySet of values that return true when applied to the refinement or predicate and a second value being a ReadonlySet of values that return false when applied to the predicate.
Examples
Example 1
Example 1
import * as S from "./set.ts";
import { pipe } from "./fn.ts";
const set = S.set(1, 2, 3, 4);
const result = pipe(
set,
S.partition(n => n > 2),
); // [Set(3, 4), Set(1, 2)]
Type Parameters
B extends A
Parameters
refinement: Refinement<A, B>