import { tag, type Tagged, type Result } from "@tsus/runtime";type Light = Tagged<"Red", {}> | Tagged<"Amber", {}> | Tagged<"Green", {}>;// Forgot Amber: a compile-time error, not a runtime TSUS100.const next = (light: Light): Light => match (light) { Red => tag("Green", {}), Green => tag("Amber", {}), };// Forgot Err.const report = (r: Result<number, string>): string => match (r) { Ok(n) => `got ${n}`, };type Method = "GET" | "POST" | "DELETE";// Literal patterns over a finite union must cover it, or add a _ arm.const verb = (m: Method): string => match (m) { "GET" => "read", "POST" => "write", };console.log(next(tag("Red", {})).tag, report, verb);