# sequenceAsync

### Option.sequenceAsync

Namespace: `FsToolkit.ErrorHandling`

Function Signature:

```fsharp
Async<'a> option -> Async<'a option>
```

Note that `sequence` is the same as `traverse id`. See also [Option.traverseAsync](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/traverseasync).

See also Scott Wlaschin's [Understanding traverse and sequence](https://fsharpforfunandprofit.com/posts/elevated-world-4/).

### Examples

#### Example 1

```fsharp
let a1 : Async<int option> =
  Option.sequenceAsync (Some (Async.singleton 42))
// async { return Some 42 }

let a2 : Async<int option> =
  Option.sequenceAsync None
// async { return None }
```
