The Impact of `Effect.tryPromise(() => ...)`
Should
Take this code for example:
As a beginner with Effect I was suprised that the type of
The reason is because
When I rewrite
then
What do you think?
Effect.tryPromise(() => ...) be discouraged?Take this code for example:
As a beginner with Effect I was suprised that the type of
getFirstNumber is Effect<never, unknown, number> instead of Effect<never, NoSuchElementException, number>The reason is because
NoSuchElementException | unknown collapses to unknownWhen I rewrite
getNumbers as:then
getFirstNumber is Effect<never, Error | NoSuchElementException, number>
Therefore, I would say that Effect.tryPromise returning Effect<never, unknown, T>` can cause lots of issues and should be discouraged.What do you think?
