effect-io-ai

Package: effect
Module: HashSet

HashSet.toValues

Returns an Array of the values within the HashSet.

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

Example

import { HashSet, pipe } from "effect"
import { deepStrictEqual } from "node:assert/strict"

deepStrictEqual(
  pipe(
    HashSet.make(0, 1, 1, 2), // HashSet<number>
    HashSet.toValues // takes an HashSet<A> and returns an Array<A>
  ),
  Array.of(0, 1, 2)
)

See

Signature

declare const toValues: <A>(self: HashSet<A>) => Array<A>

Source

Since v3.13.0