Namespace: FsToolkit.ErrorHandling

Function Signature:

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


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

Example 1

Given the function

getUserById : UserId -> Task<Result<User option, exn>>

Then using the we can get the name of the user like this:

// Task<Result<PersonName option>, exn>
getUserById sampleUserId
|> (fun user -> user.Name)

Last updated