Add a bichain function
Avaq opened this issue · comments
Aldwin Vlasblom commented
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
.