Using `effect/Match` to Provide Result Type in TypeScript

Hello,

Using effect/Match, is there anyway to provide the Result type?

In ts-pattern, I can do something like this:
match<SomeType, SomeResultType>(value)
  .with('a', 'b', () => 'ExpectedResult')
  .with('c', () => 'AnotherExpectedResult')
  ...


With effect/Match, I seem to need to do this:
Match.type<SomeType>.pipe(
  Match.when((s) => ['a', 'b'].includes(s), () => 'ExpectedResult' as SomeResultType),
  Match.when('c', () => 'AnotherExpectedResult' as SomeResultType),
  ...
)
Was this page helpful?