let write w pipe_r =
    Pipe.iter pipe_r ~f:(write_item w)