effect-io-ai

Package: effect
Module: HashSet

HashSet.size

Calculates the number of values in the HashSet.

Time complexity: O(1)

Example

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

assert.deepStrictEqual(pipe(HashSet.empty(), HashSet.size), 0)

assert.deepStrictEqual(
  pipe(HashSet.make(1, 2, 2, 3, 4, 3), HashSet.size),
  4
)

See

Signature

declare const size: <A>(self: HashSet<A>) => number

Source

Since v2.0.0