mirror of
https://github.com/c-cube/iter.git
synced 2025-12-06 11:15:32 -05:00
sequence.concat_str
This commit is contained in:
parent
e0a95a3c31
commit
77d74953fd
2 changed files with 10 additions and 0 deletions
|
|
@ -591,6 +591,11 @@ let to_str seq =
|
||||||
iter (fun c -> Buffer.add_char b c) seq;
|
iter (fun c -> Buffer.add_char b c) seq;
|
||||||
Buffer.contents b
|
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 =
|
let of_in_channel ic =
|
||||||
from_iter (fun k ->
|
from_iter (fun k ->
|
||||||
try while true do
|
try while true do
|
||||||
|
|
|
||||||
|
|
@ -366,6 +366,11 @@ val hashtbl_values : ('a, 'b) Hashtbl.t -> 'b t
|
||||||
val of_str : string -> char t
|
val of_str : string -> char t
|
||||||
val to_str : char t -> string
|
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
|
val of_in_channel : in_channel -> char t
|
||||||
(** Iterates on characters of the input (can block when one
|
(** Iterates on characters of the input (can block when one
|
||||||
iterates over the sequence). If you need to iterate
|
iterates over the sequence). If you need to iterate
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue