Best way to condense a list of option type down to only elements that are not none?
Simply
List.choose id
as in
> [Some 4; None; Some 2; None] |> List.choose id;;
val it : int list = [4; 2]
List.choose
id
Simply
List.choose id
as in
> [Some 4; None; Some 2; None] |> List.choose id;;
val it : int list = [4; 2]
List.choose
id