let rec fprint_list sep print ff l =
  match l with
  | [] -> ()
  | [x] -> print ff x
  | x :: l -> Format.fprintf ff "%a%(%)%a" print x sep (fprint_list sep print) l