Question regarding expected behavior of TE.fromTask #1791
niklaserik
started this conversation in
General
Replies: 3 comments 2 replies
-
|
@niklaserik that's how it should work, could you provide a repro? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@gcanti check the types of the anonymous functions in the dummy code below; Getting the same issue with |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Thank you for the advice and the awesome library. Works perfectly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I want to start to thank you for a great library!
My question is regarding the type of the natural transformation
TaskEither'sfromTasktype. I have a chain of TaskEithers and hence I want to convert a my Task into a TaskEither to get a nice flow in the code. Since a Task never is supposed to fail, I expected the type after the transformation to beTE.TaskEither<never, T>. However, the transformation resulted in the typeTE.TaskEither<unknown, T>I can achieve the expected behavior by making an anonymous function like
TE.chainW(flow(functionReturningTask, (a) => TE.fromTask<T, never>(a)))but it would be nice to just be able to writeTE.chainW(flow(functionReturningTask, TE.fromTask ))Perhaps there is a reason I an not aware about why it converts it to
unknown´ instead ofnever`?Beta Was this translation helpful? Give feedback.
All reactions