intersection
import { intersection } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/set.ts";Given an instance of Comparable return a function that takes two ReadonlySets and returns a new set with only the elements that exist in both sets.
@example
import * as S from "./set.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";
const intersect = S.intersection(N.ComparableNumber);
const s1 = S.set(1, 2, 3, 4);
const s2 = S.set(3, 4, 5, 6);
const result = pipe(s1, intersect(s2));
// Set(3, 4)
function intersection<A>(S: Comparable<A>): (ua: ReadonlySet<A>) => (tb: ReadonlySet<A>) => ReadonlySet<A>;