> 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.icedtasks/index-2/apply.md).

# apply

Namespace: `FsToolkit.ErrorHandling`

Function Signature:

```fsharp
CancellableValueTask<Result<('a -> 'b), 'c>> -> CancellableValueTask<Result<'a, 'c>> -> CancellableValueTask<Result<'b, 'c>>
```

## Examples

### Example 1

```fsharp
let result =
    CancellableValueTaskResult.singleton "foo"
    |> CancellableValueTaskResult.apply (CancellableValueTaskResult.singleton String.length)

// cancellableValueTask { Ok 3 }
```

### Example 2

```fsharp
let err : CancellableValueTask<Result<int, string>> = cancellableValueTask { return Error "some error" }
let result =
    err
    |> CancellableValueTaskResult.apply (CancellableValueTaskResult.singleton String.length)

// cancellableValueTask { Error "some error" }
```
