let set_of_list_b xs = let rec loop xs s = match xs with [] -> s | x::xs' -> (loop xs' (add_elt x s)) in loop xs []