effect-io-ai

Package: effect
Module: HashSet

HashSet.HashSet.Value

Extracts the element type from a HashSet.

Details

For HashSet.HashSet<A>, HashSet.Value<...> resolves to A.

Example (Extracting a HashSet value type)

import { HashSet } from "effect"

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

// Extract the value type
type NumberType = HashSet.HashSet.Value<typeof numbers> // number

const processNumber = (n: NumberType) => n * 2

Signature

type Value<T> = T extends HashSet<infer V> ? V : never

Source

Since v4.0.0