Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 663 Bytes

File metadata and controls

30 lines (19 loc) · 663 Bytes

TaskResult.bind

Namespace: FsToolkit.ErrorHandling

Function Signature:

('a -> Task<Result<'b, 'c>>)
  -> Task<Result<'a, 'c>>
  -> Task<Result<'b, 'c>>

Examples

Note: Many use-cases requiring bind operations can also be solved using the taskResult computation expression.

Example 1

Continuing from the TaskResult.map2 example and given the function

let notifyFollowers : NotifyNewPostRequest -> Task<Result<unit,exn>>

we can notify all followers using TaskResult.bind as below:

newPostRequestResult |> TaskResult.bind notifyFollowers