Hyperlinkv0.8.0-beta.28

HashSet

HashSet.fromIterableconsteffect/HashSet.ts:174
<V>(values: Iterable<V>): HashSet<V>

Creates a HashSet from an iterable collection of values.

Example (Creating a HashSet from an iterable)

import { HashSet } from "effect"

const fromArray = HashSet.fromIterable(["a", "b", "c", "b", "a"])
console.log(HashSet.size(fromArray)) // 3

const fromSet = HashSet.fromIterable(new Set([1, 2, 3]))
console.log(HashSet.size(fromSet)) // 3

const fromString = HashSet.fromIterable("hello")
console.log(Array.from(fromString)) // ["h", "e", "l", "o"]
constructors
Source effect/HashSet.ts:1741 lines
export const fromIterable: <V>(values: Iterable<V>) => HashSet<V> = internal.fromIterable
Referenced by 2 symbols