Package: effect
Module: Schema
Returns a property signature that represents a tag.
A tag is a literal value that is used to distinguish between different types of objects.
The tag is optional when using the make method.
Example
import * as assert from "node:assert"
import { Schema } from "effect"
const User = Schema.Struct({
_tag: Schema.tag("User"),
name: Schema.String,
age: Schema.Number
})
assert.deepStrictEqual(User.make({ name: "John", age: 44 }), { _tag: "User", name: "John", age: 44 })
See
TaggedStructSignature
declare const tag: <Tag extends AST.LiteralValue>(tag: Tag) => tag<Tag>
Since v3.10.0