Hyperlinkv0.8.0-beta.28

HashSet

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

Checks whether all values in the HashSet satisfy the predicate.

Example (Testing whether every value matches)

import { HashSet } from "effect"

const numbers = HashSet.make(2, 4, 6, 8)

console.log(HashSet.every(numbers, (n) => n % 2 === 0)) // true
console.log(HashSet.every(numbers, (n) => n > 5)) // false

const empty = HashSet.empty<number>()
console.log(HashSet.every(empty, (n) => n > 0)) // true (vacuously true)
elements
Source effect/HashSet.ts:5707 lines
export const every: {
  <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.every)
Referenced by 1 symbols