traverseVOptionM
Function Signature
('a -> 'b voption) -> 'a list -> 'b list voptionExamples
Example 1
let tryParseInt (s: string) =
match Int32.TryParse(s) with
| true, i -> ValueSome i
| false, _ -> ValueNone
let myList = ["123"; "456"; "789"]
List.traverseVOptionM tryParseInt myList
// Some [123; 456; 789]Example 2
Last updated