Match.type
特定の型に対するマッチング
返り値は関数
code:ts
const match = Match.type<string | number>().pipe(
Match.when(Match.number, (n) => number: ${n}),
Match.when(Match.string, (s) => string: ${s}),
Match.exhaustive
)
match(0) // "number: 0"
match("hi") // "string: hi"
あんまり使い所がわからないmrsekut.icon