sequence.concat_str

This commit is contained in:
Simon Cruanes 2014-07-07 17:34:12 +02:00
parent e0a95a3c31
commit 77d74953fd
2 changed files with 10 additions and 0 deletions

View file

@ -591,6 +591,11 @@ let to_str seq =
iter (fun c -> Buffer.add_char b c) seq;
Buffer.contents b
let concat_str seq =
let b = Buffer.create 64 in
iter (Buffer.add_string b) seq;
Buffer.contents b
let of_in_channel ic =
from_iter (fun k ->
try while true do

View file

@ -366,6 +366,11 @@ val hashtbl_values : ('a, 'b) Hashtbl.t -> 'b t
val of_str : string -> char t
val to_str : char t -> string
val concat_str : string t -> string
(** Concatenate strings together, eagerly.
Also see {!intersperse} to add a separator.
@since NEXT_VERSION *)
val of_in_channel : in_channel -> char t
(** Iterates on characters of the input (can block when one
iterates over the sequence). If you need to iterate