Package: effect
Module: Data
Extracts the full variant type (including _tag) for a specific tag.
When to use
Use to select one full tagged-union variant by its _tag value.
Example (Extracting a variant type)
import type { Data } from "effect"
type Result =
| { readonly _tag: "Ok"; readonly value: number }
| { readonly _tag: "Err"; readonly error: string }
type OkVariant = Data.TaggedEnum.Value<Result, "Ok">
// { readonly _tag: "Ok"; readonly value: number }
See
Args — extracts fields without _tagSignature
type Value<A, K> = Extract<A, { readonly _tag: K }>
Since v2.0.0