> For the complete documentation index, see [llms.txt](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/asyncresult/ok.md).

# ok

### AsyncResult.ok

Namespace: `FsToolkit.ErrorHandling`

Lift an `'ok` value into an `Async<Result<'ok, 'error>>`

### Function Signature:

```fsharp
'ok -> Async<Result<'ok, 'error>>
```

### Examples

#### Example 1

```fsharp
let result : Async<Result<int, string>> =
  AsyncResult.ok 42
```

#### Example 2

Using `AsyncResult.ok` inside a pipeline:

```fsharp
let getUser (id: UserId) : Async<Result<User, string>> =
  asyncResult {
    let! user = fetchUser id
    return user
  }

// Lifting a simple value to AsyncResult:
let defaultUser : Async<Result<User, string>> =
  AsyncResult.ok { Id = UserId 0; Name = "Guest" }
```
