add CCVector.to_string

This commit is contained in:
Fardale 2019-10-29 20:49:17 +01:00
parent 087612823e
commit 38966f7c92
2 changed files with 9 additions and 0 deletions

View file

@ -942,6 +942,9 @@ let to_klist v =
else `Cons (v.vec.(i), aux (i+1))
in aux 0
let to_string ?(start="") ?(stop="") ?(sep=", ") item_to_string v =
to_list v |> CCList.to_string ~start ~stop ~sep item_to_string
let pp ?(start="") ?(stop="") ?(sep=", ") pp_item fmt v =
Format.pp_print_string fmt start;
iteri

View file

@ -287,5 +287,11 @@ val to_klist : ('a,_) t -> 'a klist
val of_gen : ?init:('a, rw) t -> 'a gen -> ('a, rw) t
val to_gen : ('a,_) t -> 'a gen
val to_string :
?start:string -> ?stop:string -> ?sep:string ->
('a -> string) -> ('a,_) t -> string
(** Print the vector in a string
@since NEXT_RELEASE *)
val pp : ?start:string -> ?stop:string -> ?sep:string ->
'a printer -> ('a,_) t printer