Type Inference Issue with ParseResult and Effect.all in Schema.transformOrFail
Type inference issue with ParseResult.decodeUnknown and Effect.all in Schema.transformOrFail
I'm experiencing a Requirements channel widening issue when composing ParseResult operations in Schema.transformOrFail.
Individual ParseResult.decodeUnknown calls correctly return R = never:
Simple Effect.all compositions preserve R = never:
However, using Effect.all with an object inside Schema.transformOrFail causes TypeScript to infer R = unknown:
This produces a compilation error:
Full reproduction: https://effect.website/play#ca4d68c96691
Why does TypeScript widen the Requirements channel from never to unknown in this specific composition pattern? Is this expected behavior or am I missing something about how to properly compose ParseResult operations in transformOrFail?
I'm experiencing a Requirements channel widening issue when composing ParseResult operations in Schema.transformOrFail.
Individual ParseResult.decodeUnknown calls correctly return R = never:
Simple Effect.all compositions preserve R = never:
However, using Effect.all with an object inside Schema.transformOrFail causes TypeScript to infer R = unknown:
This produces a compilation error:
Full reproduction: https://effect.website/play#ca4d68c96691
Why does TypeScript widen the Requirements channel from never to unknown in this specific composition pattern? Is this expected behavior or am I missing something about how to properly compose ParseResult operations in transformOrFail?
