map
Namespace: FsToolkit.ErrorHandling
Apply a function to the value of an option if it is Some. If the option is None, return None.
Function Signature
('TInput-> 'TOutput) -> 'TInput option -> 'TOutput optionExamples
Example 1
Option.map (fun x -> x + 1) (Some 1)
// Some 2Example 2
Option.map (fun x -> x + 1) None
// NoneLast updated