Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 594 Bytes

File metadata and controls

30 lines (18 loc) · 594 Bytes

CancellableTaskOption.map

Namespace: FsToolkit.ErrorHandling

Apply a function to the value of a cancellable task option if it is Some. If the option is None, return None.

Function Signature

('input -> 'output) -> CancellableTask<'input option> -> CancellableTask<'output option>

Examples

Example 1

CancellableTaskOption.map (fun x -> x + 1) (CancellableTaskOption.some 1)

// cancellableTask { Some 2 }

Example 2

CancellableTaskOption.map (fun x -> x + 1) (CancellableTask.singleton None)

// cancellableTask { None }