Files
scriptc/tests/fixtures/effect/data-match.ts
Chris Tate 2069684b40 Expand static Effect support across common APIs (#598)
* Expand static Effect support across common APIs

* Preserve compiler parity across expanded Effect patterns

* Fix compiler regressions exposed by Effect coverage

* Bound shared type conversion traversal

* Clarify conversion contracts and tidy fixtures

* Run every Effect fixture in CI shards

* Preserve inferred array assignments in concurrent Effect programs

* Record inferred array fixture compiler ordering
2026-10-01 02:49:31 -05:00

7 lines
397 B
TypeScript

import { Match, pipe } from "effect";
type Result = { readonly _tag: "Ok"; readonly n: number } | { readonly _tag: "Bad"; readonly message: string };
function render(v: Result) {
return pipe(Match.value(v), Match.tag("Ok", (r) => "ok:" + r.n), Match.tag("Bad", (r) => "bad:" + r.message), Match.exhaustive);
}
console.log(render({ _tag: "Ok", n: 42 }), render({ _tag: "Bad", message: "oops" }));