-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add W-variants to Do, e.g. bindLW #64
Comments
Can you give some examples how I can use different error types with Do notation without W-variants? |
Something like that? type allErrors = Error1 | Error2;
Do(TE.taskEither)
.bind(
'result1',
pipe(
TE.right<Error1, number>(1),
TE.mapLeft((err): allErrors => err),
),
)
.bind('result2', TE.right<Error2, number>(2)); |
I too have encountered this problem. My errors are a union of string constants, and it would be nice to have a |
I recommend to use native fp-ts Do notaion - https://github.com/gcanti/fp-ts/releases/tag/2.8.0. |
🚀 Feature request
Current Behavior
fails with:
Desired Behavior
Where
foo
would beTaskEither<boolean | string, { te1: number} & { te2: string }>
.Suggested Solution
🤷♂️
Do
is a complex beast.Who does this impact? Who is this for?
This would alleviate the need to lift the first
bind
'sLeft
into a union of all possible error types, which I believe is the current accepted workaround. This was the case forEither
'schain
too, untilchainW
was added recently. It would be great if we could get the same forDo
.The text was updated successfully, but these errors were encountered: