7 let rec uniq ?(cmp = Pervasives.compare) = function
10 | x :: y :: xs when cmp x y = 0 ->
13 x :: uniq ~cmp (y :: xs)
15 let sort_uniq ?(cmp = Pervasives.compare) xs =
16 let xs = List.sort cmp xs in
17 let xs = uniq ~cmp xs in
20 let rec filter_map f = function
24 | Some y -> y :: filter_map f xs
25 | None -> filter_map f xs