compact
import { compact } from "https://raw.githubusercontent.com/baetheus/fun/main/set.ts";
Given an instance of Comparable create a function that will take a ReadonlySet and return a new ReadonlySet where any members that are equal are deduplicated.
@example
import * as S from "./set.ts";
import * as N from "./number.ts";
import * as E from "./comparable.ts";
const eq = E.struct({ num: N.ComparableNumber });
const compact = S.compact(eq);
const set = S.set({ num: 1 }, { num: 1 }, { num: 2 });
// Set({ num: 1 }, { num: 1 }, { num: 2 })
const result = compact(set); // Set({ num: 1 }, { num: 2 })