Hyperlinkv0.8.0-beta.28

HashSet

HashSet.someconsteffect/HashSet.ts:542
<V>(predicate: Predicate<V>): (self: HashSet<V>) => boolean
<V>(self: HashSet<V>, predicate: Predicate<V>): boolean

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
elements
Source effect/HashSet.ts:5427 lines
export const some: {
  <V>(predicate: Predicate<V>): (self: HashSet<V>) => boolean
  <V>(self: HashSet<V>, predicate: Predicate<V>): boolean
} = Dual.dual<
  <V>(predicate: Predicate<V>) => (self: HashSet<V>) => boolean,
  <V>(self: HashSet<V>, predicate: Predicate<V>) => boolean
>(2, internal.some)
Referenced by 1 symbols