bind

CancellableTaskResult.bind

Namespace: FsToolkit.ErrorHandling

Function Signature:

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

Examples

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

Example 1

Continuing from the CancellableTaskResult.map2 example and given the function

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

We can notify all followers using CancellableTaskResult.bind as below:

newPostRequestResult |> CancellableTaskResult.bind notifyFollowers

Last updated