demystifyfp/FsToolkit.ErrorHandling

Add Result.traverseAsync

cmeeren opened this issue · 3 comments

There is currently a Result.sequenceAsync. Adding a Result.traverseAsync would complement the API and should be fairly easy to implement.

Unfortunately have my hands full at nowadays and can't make a PR, but wanted to at least create an issue.

njlr commented

What would the signature of this be?

('t -> Async<'u>) -> Result<'t, 'e> -> Async<Result<'u, 'e>> ?

IIRC it should be the same as Result.map >> Result.sequenceAsync. (Can probably be implemented slightly more efficiently than that composition, though whether it matters I have no idea...)