Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

union

import { union } 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 merges them into a new ReadonlySet that contains all the elements from both sets.

@example
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)
function union<A>(S: Comparable<A>): (second: ReadonlySet<A>) => (first: ReadonlySet<A>) => ReadonlySet<A>;
§
union<A>(S: Comparable<A>): (second: ReadonlySet<A>) => (first: ReadonlySet<A>) => ReadonlySet<A>
[src]

§Type Parameters

§Parameters

§Return Type

§
(second: ReadonlySet<A>) => (first: ReadonlySet<A>) => ReadonlySet<A>
[src]