Skip to content
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 a bichain function #332

Closed
Avaq opened this issue Apr 24, 2019 · 0 comments · Fixed by #411
Closed

Add a bichain function #332

Avaq opened this issue Apr 24, 2019 · 0 comments · Fixed by #411
Assignees

Comments

@Avaq
Copy link
Member

Avaq commented Apr 24, 2019

bichain :: (a -> Future x y) -> (b -> Future x y) -> Future a b -> Future x y

Currently the only way to bichain is like this:

compose (chain (x => x)) (coalesce (f) (g))

It's not straightforward and one might be inclined to do something like this instead:

compose (chainRej (f)) (chain (g))

However, this solution behaves different from how bichain would, in that if g returns a rejected Future, its rejection is handled by f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants