let string_of_list str begin_delim end_delim sep l = match l with | [] -> begin_delim ^ end_delim | x::q -> begin_delim ^ (str x) ^ (List.fold_left (fun acc s -> acc ^ sep ^ (str s)) "" q) ^ end_delim let uniq l = let h = Hashtbl.create 17 in List.fold_left (fun acc x -> if not (Hashtbl.mem h x) then ( Hashtbl.add h x true; x::acc ) else acc ) [] l