sequenceJobResultA

List.sequenceJobResultA

Namespace: FsToolkit.ErrorHandling

Function Signature:

Job<Result<'a, 'b>> list -> Job<Result<'a list, 'b list>>

This is the same as List.traverseJobResultA with id as the mapping function.

This is applicative, collecting all errors rather than stopping at the first. Compare with sequenceJobResultM, which short-circuits on first error.

See also Scott Wlaschin's Understanding traverse and sequencearrow-up-right.

Examples

Example 1

let jobs =
    [ JobResult.singleton 1
      JobResult.singleton 2
      JobResult.singleton 3 ]

jobs |> List.sequenceJobResultA
// job { return Ok [1; 2; 3] }

Example 2

Last updated