sequenceAsyncResult
Option.sequenceAsyncResult
Async<Result<'a, 'e>> option -> Async<Result<'a option>, 'e>Examples
Example 1
let r1 : Async<Result<int option, string>> =
Some (async { return Ok 42 }) |> Option.sequenceAsyncResult
// async { return Ok (Some 42) }
let r2 : Async<Result<int option, string>> =
Some (async { return Error "something went wrong" }) |> Option.sequenceAsyncResult
// async { return Error "something went wrong" }
let r3 : Async<Result<int option, string>> =
None |> Option.sequenceAsyncResult
// async { return Ok None }Last updated