map3
Namespace: FsToolkit.ErrorHandling
Apply a function to the values of three options if they are Some. If any option is None, return None.
Function Signature
('TInput1 -> 'TInput2 -> 'TInput3 -> 'TOutput) -> 'TInput1 option -> 'TInput2 option -> 'TInput3 option -> 'TOutput optionExamples
Example 1
Option.map3 (fun x y z -> x + y + z) (Some 1) (Some 2) (Some 3)
// Some 6Example 2
Option.map3 (fun x y z -> x + y + z) (Some 1) (Some 2) None
// NoneExample 3
Option.map3 (fun x y z -> x + y + z) (Some 1) None (Some 3)
// NoneExample 4
Option.map3 (fun x y z -> x + y + z) None (Some 2) (Some 3)
// NoneLast updated