let to_string pp x = 
  pp Format.str_formatter x;
  Format.flush_str_formatter ()