// change _tag to intent
type Choice = Data.TaggedEnum<"intent", {
One: {},
Two: {},
Three: {}
}>
const Choice = Data.taggedEnum<Choice>()
const input: Choice = { intent: "One" }
return Choice.$match(input, {
One: () => 1,
Two: () => 2,
Three: () => 3,
})
// change _tag to intent
type Choice = Data.TaggedEnum<"intent", {
One: {},
Two: {},
Three: {}
}>
const Choice = Data.taggedEnum<Choice>()
const input: Choice = { intent: "One" }
return Choice.$match(input, {
One: () => 1,
Two: () => 2,
Three: () => 3,
})