let stream_to_out_channel xs tr oc =
  Stream.iter (to_stream_fun tr xs) ~f:(output_string oc)