(Future : Future.S) = struct
open Future
let read r =
Reader.lines r
|> Pipe.map ~f:Line.of_string_unsafe
let write w pipe_r = Pipe.iter pipe_r ~f:(fun item ->
Writer.write_line w (item : item :> string)
)
let write_file ?perm ?append file pipe_r =
Writer.with_file ?perm ?append file ~f:(fun w -> write w pipe_r)
end