diff --git a/sequence.ml b/sequence.ml index 7973aa7..5c0d129 100644 --- a/sequence.ml +++ b/sequence.ml @@ -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 diff --git a/sequence.mli b/sequence.mli index 767e913..f822a0a 100644 --- a/sequence.mli +++ b/sequence.mli @@ -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