effect-io-ai

Package: effect
Module: HashSet

HashSet.union

Computes the set union ( self ∪ that ) between this HashSet and the specified Iterable<A>.

Time complexity: O(n) where n is the number of elements in the set

NOTE: the hash and equal of the values in both the set and the iterable must be the same.

Example

// Syntax
import { HashSet, pipe } from "effect"

// with data-last, a.k.a. pipeable API
pipe(HashSet.make(1, 2, 3), HashSet.union(HashSet.make(3, 4, 5)))

// or piped with the pipe function
HashSet.make(1, 2, 3).pipe(HashSet.union(HashSet.make(3, 4, 5)))

// or with data-first API
HashSet.union(HashSet.make(1, 2, 3), HashSet.make(3, 4, 5))

See

Signature

declare const union: { <A>(that: Iterable<A>): (self: HashSet<A>) => HashSet<A>; <A>(self: HashSet<A>, that: Iterable<A>): HashSet<A>; }

Source

Since v2.0.0