# either

Namespace: `FsToolkit.ErrorHandling`

## Function Signature

Provide two functions to execute depending on the value of the option. If the option is `Some`, the first function will be executed. If the option is `None`, the second function will be executed.

```fsharp
(onSome : 'T -> CancellableTask<'output>) 
	-> (onNone : CancellableTask<'output>) 
	-> (input : CancellableTask<'T option>) 
	-> CancellableTask<'output>
```

## Examples

### Example 1

```fsharp
CancellableTaskOption.either (fun x -> cancellableTask { x * 2 }) (cancellableTask { 0 }) (CancellableTaskOption.some 5)

// cancellableTask { 10 }
```

### Example 2

```fsharp
CancellableTaskOption.either (fun x -> x * 2) (cancellableTask { 0 }) None

// cancellableTask { 0 }
```
