import { set } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { union } = set;
Given an instance of Comparable return a function that takes two ReadonlySets and merges them into a new ReadonlySet that contains all the elements from both sets.
Examples
Example 1
Example 1
import * as S from "./set.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";
const union = S.union(N.ComparableNumber);
const s1 = S.set(1, 2, 3, 4);
const s2 = S.set(3, 4, 5, 6);
const result = pipe(s1, union(s2));
// Set(1, 2, 3, 4, 5, 6)
Parameters
S: Comparable<A>