<V1>(that: HashSet<V1>): <V0>(self: HashSet<V0>) => HashSet<V1 & V0>
<V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>Creates the intersection of two HashSets.
Example (Finding common HashSet values)
import { HashSet } from "effect"
const set1 = HashSet.make("a", "b", "c")
const set2 = HashSet.make("b", "c", "d")
const common = HashSet.intersection(set1, set2)
console.log(Array.from(common).sort()) // ["b", "c"]
console.log(HashSet.size(common)) // 2export const const intersection: {
<V1>(that: HashSet<V1>): <V0>(
self: HashSet<V0>
) => HashSet<V1 & V0>
<V0, V1>(
self: HashSet<V0>,
that: HashSet<V1>
): HashSet<V0 & V1>
}
Creates the intersection of two HashSets.
Example (Finding common HashSet values)
import { HashSet } from "effect"
const set1 = HashSet.make("a", "b", "c")
const set2 = HashSet.make("b", "c", "d")
const common = HashSet.intersection(set1, set2)
console.log(Array.from(common).sort()) // ["b", "c"]
console.log(HashSet.size(common)) // 2
intersection: {
<function (type parameter) V1 in <V1>(that: HashSet<V1>): <V0>(self: HashSet<V0>) => HashSet<V1 & V0>V1>(that: HashSet<V1>(parameter) that: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
that: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V1 in <V1>(that: HashSet<V1>): <V0>(self: HashSet<V0>) => HashSet<V1 & V0>V1>): <function (type parameter) V0 in <V0>(self: HashSet<V0>): HashSet<V1 & V0>V0>(self: HashSet<V0>(parameter) self: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V0 in <V0>(self: HashSet<V0>): HashSet<V1 & V0>V0>) => interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V1 in <V1>(that: HashSet<V1>): <V0>(self: HashSet<V0>) => HashSet<V1 & V0>V1 & function (type parameter) V0 in <V0>(self: HashSet<V0>): HashSet<V1 & V0>V0>
<function (type parameter) V0 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V0, function (type parameter) V1 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V1>(self: HashSet<V0>(parameter) self: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V0 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V0>, that: HashSet<V1>(parameter) that: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
that: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V1 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V1>): interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V0 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V0 & function (type parameter) V1 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V1>
} = import DualDual.dual<
<function (type parameter) V1 in <V1>(that: HashSet<V1>): <V0>(self: HashSet<V0>) => HashSet<V1 & V0>V1>(that: HashSet<V1>(parameter) that: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
that: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V1 in <V1>(that: HashSet<V1>): <V0>(self: HashSet<V0>) => HashSet<V1 & V0>V1>) => <function (type parameter) V0 in <V0>(self: HashSet<V0>): HashSet<V1 & V0>V0>(self: HashSet<V0>(parameter) self: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V0 in <V0>(self: HashSet<V0>): HashSet<V1 & V0>V0>) => interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V1 in <V1>(that: HashSet<V1>): <V0>(self: HashSet<V0>) => HashSet<V1 & V0>V1 & function (type parameter) V0 in <V0>(self: HashSet<V0>): HashSet<V1 & V0>V0>,
<function (type parameter) V0 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V0, function (type parameter) V1 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V1>(self: HashSet<V0>(parameter) self: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V0 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V0>, that: HashSet<V1>(parameter) that: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
that: interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V1 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V1>) => interface HashSet<out Value>A HashSet is an immutable set data structure that provides efficient storage
and retrieval of unique values. It uses a HashMap internally for optimal performance.
Example (Creating and updating a HashSet)
import { HashSet } from "effect"
// Create a HashSet
const set = HashSet.make("apple", "banana", "cherry")
// Check membership
console.log(HashSet.has(set, "apple")) // true
console.log(HashSet.has(set, "grape")) // false
// Add values (returns new HashSet)
const updated = HashSet.add(set, "grape")
console.log(HashSet.size(updated)) // 4
// Remove values (returns new HashSet)
const smaller = HashSet.remove(set, "banana")
console.log(HashSet.size(smaller)) // 2
The HashSet namespace contains type-level utilities and helper types
for working with HashSet instances.
Example (Extracting value types from a HashSet)
import { HashSet } from "effect"
// Create a concrete HashSet for type extraction
const fruits = HashSet.make("apple", "banana", "cherry")
// Extract the value type for reuse
type Fruit = HashSet.HashSet.Value<typeof fruits> // string
// Use extracted type in functions
const processFruit = (fruit: Fruit) => {
return `Processing ${fruit}`
}
HashSet<function (type parameter) V0 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V0 & function (type parameter) V1 in <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1>V1>
>(2, import internalinternal.const intersection: <V0, V1>(
self: internal.HashSet<V0>,
that: internal.HashSet<V1>
) => internal.HashSet<V0 & V1>
intersection)