map2
Function Signature
('TInput1 -> 'TInput2 -> 'TOutput) -> 'TInput1 option -> 'TInput2 option -> 'TOutput optionExamples
Example 1
Option.map2 (fun x y -> x + y) (Some 1) (Some 2)
// Some 3Example 2
Option.map2 (fun x y -> x + y) (Some 1) None
// NoneExample 3
Last updated