Last updated 3 years ago
Namespace: FsToolkit.ErrorHandling
FsToolkit.ErrorHandling
Function Signature:
('a -> Async<Result<'b, 'c>>) -> Async<Result<'a, 'c>> -> Async<Result<'b, 'c>>
Note: Many use-cases requiring bind operations can also be solved using .
bind
Continuing from the AsyncResult.map2 example and given the function
let notifyFollowers : NotifyNewPostRequest -> Async<Result<unit,exn>>
we can notify all followers using AsyncResult.bind as below:
AsyncResult.bind
newPostRequestResult |> AsyncResult.bind notifyFollowers
asyncResult