MCPcopy
hub / github.com/Effect-TS/effect / tagged

Function tagged

packages/effect/src/Data.ts:171–178  ·  view source on GitHub ↗
(
  tag: A["_tag"]
)

Source from the content-addressed store, hash-verified

169 * @category constructors
170 */
171export const tagged = <A extends { readonly _tag: string }>(
172 tag: A["_tag"]
173): Case.Constructor<A, "_tag"> =>
174(args) => {
175 const value = args === undefined ? Object.create(StructuralPrototype) : struct(args)
176 value._tag = tag
177 return value
178}
179
180/**
181 * Provides a constructor for a Case Class.

Callers 1

getFunction · 0.70

Calls 2

createMethod · 0.80
structFunction · 0.70

Tested by

no test coverage detected