let rec nb_distinct = function a :: b :: t when a = b -> nb_distinct (b::t) | a :: b :: t -> 1+ nb_distinct (b::t) | _ :: [] -> 1 | [] -> 0