let to_channel xs oc =
  Stream.iter xs ~f:(fun l ->
    output_string oc (l : item :> string); output_char oc '\n'
  )