> 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/map.md).

# map

Namespace: `FsToolkit.ErrorHandling`

Apply a function to the `Ok` value of a `CancellableValueTask<Result<'a, 'b>>` and return a new `CancellableValueTask<Result<'c, 'b>>`.

## Function Signature

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

## Examples

### Example 1

```fsharp
CancellableValueTaskResult.map (fun x -> x + 1) (CancellableValueTaskResult.singleton 1)

// cancellableValueTask { Ok 2 }
```

### Example 2

```fsharp
let err : CancellableValueTask<Result<int, string>> = cancellableValueTask { return Error "some error" }
CancellableValueTaskResult.map (fun x -> x + 1) err

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