effect-io-ai

Package: effect
Module: HashSet

HashSet.some

Checks whether at least one value in the HashSet satisfies the predicate.

Example (Testing whether some values match)

import { HashSet } from "effect"

const numbers = HashSet.make(1, 2, 3, 4, 5)

console.log(HashSet.some(numbers, (n) => n > 3)) // true
console.log(HashSet.some(numbers, (n) => n > 10)) // false

const empty = HashSet.empty<number>()
console.log(HashSet.some(empty, (n) => n > 0)) // false

Signature

declare const some: { <V>(predicate: Predicate<V>): (self: HashSet<V>) => boolean; <V>(self: HashSet<V>, predicate: Predicate<V>): boolean; }

Source

Since v2.0.0