let print_separated_list separator print_elem xs =
let rec loop x = function
| [] ->
print_elem x
| y :: xs ->
print_elem x ^
separator ^
loop y xs
in
match xs with
| [] ->
""
| x :: xs ->
loop x xs