mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-16 23:56:43 -05:00
add CCVector.to_string
This commit is contained in:
parent
087612823e
commit
38966f7c92
2 changed files with 9 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue