MCPcopy Create free account
hub / github.com/Effect-TS/effect / TaggedClass

Function TaggedClass

packages/effect/src/Data.ts:91–98  ·  view source on GitHub ↗
(
  tag: Tag
)

Source from the content-addressed store, hash-verified

89 * @since 2.0.0
90 */
91export const TaggedClass = <Tag extends string>(
92 tag: Tag
93): new<A extends Record<string, any> = {}>(
94 args: Types.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>
95) => Readonly<A> & { readonly _tag: Tag } & Pipeable.Pipeable =>
96 class extends Class {
97 readonly _tag = tag
98 } as any
99
100/**
101 * Transforms a record of variant definitions into a discriminated union type.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected