Effect-TS Match Type Inference Returning Option<unknown> Instead of Option<number>
Hi everyone,
I'm using Effect-TS's Match utility to process input values and return an
Here's the relevant code snippet:
Details of expectations:
Number.parse is a function of type
Numbers are directly wrapped in
For any other types (e.g., objects), they are handled by
Given these conditions, I expect the type of a to be
Is there something I'm overlooking about how Match handles type inference, or is there an adjustment I can make to ensure the result is correctly typed as
Any advice would be greatly appreciated! Thank you!
I'm using Effect-TS's Match utility to process input values and return an
Option<number>. However, my implementation is currently yielding a result of type Option<unknown> instead of Option<number>.Here's the relevant code snippet:
Details of expectations:
Number.parse is a function of type
(s: string) => Option<number>. For strings, I expect this to return an Option<number>.Numbers are directly wrapped in
Option.some, so this branch should also produce an Option<number>.For any other types (e.g., objects), they are handled by
Option.none. As a result, all possible cases should lead to an Option<number>.Given these conditions, I expect the type of a to be
Option<number>. However, the inferred type is currently Option<unknown>.Is there something I'm overlooking about how Match handles type inference, or is there an adjustment I can make to ensure the result is correctly typed as
Option<number>?Any advice would be greatly appreciated! Thank you!

