From 40b72a8017c9de42df01965b5949225743dbd5e7 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Mar 2026 15:52:32 +0000 Subject: [PATCH] Add Data.TaggedEnum example to taggedEnum JSDoc The taggedEnum constructor was missing an example showing the common pattern of using Data.TaggedEnum<{...}> as the type parameter. The existing examples only showed the verbose union syntax and the generics case. https://claude.ai/code/session_01TxYNArXXjCjYYQ4yWbwvYY --- packages/effect/src/Data.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/effect/src/Data.ts b/packages/effect/src/Data.ts index f4910d487fe..f4a84e2e016 100644 --- a/packages/effect/src/Data.ts +++ b/packages/effect/src/Data.ts @@ -438,6 +438,20 @@ export declare namespace TaggedEnum { * ``` * * @example + * ```ts + * import { Data } from "effect" + * + * type HttpError = Data.TaggedEnum<{ + * BadRequest: { readonly status: 400; readonly message: string } + * NotFound: { readonly status: 404; readonly message: string } + * }> + * + * const { BadRequest, NotFound } = Data.taggedEnum() + * + * const notFound = NotFound({ status: 404, message: "Not Found" }) + * ``` + * + * @example * import { Data } from "effect" * * type MyResult = Data.TaggedEnum<{