mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-16 23:56:43 -05:00
add CCPair.to_string
This commit is contained in:
parent
3dfbbeb3e3
commit
f8bdceda14
2 changed files with 6 additions and 0 deletions
|
|
@ -42,6 +42,8 @@ let compare f g (x1,y1) (x2,y2) =
|
||||||
let c = f x1 x2 in
|
let c = f x1 x2 in
|
||||||
if c <> 0 then c else g y1 y2
|
if c <> 0 then c else g y1 y2
|
||||||
|
|
||||||
|
let to_string ?(sep=", ") a_to_string b_to_string (x,y) =
|
||||||
|
Printf.sprintf "%s%s%s" (a_to_string x) sep (b_to_string y)
|
||||||
|
|
||||||
type 'a printer = Format.formatter -> 'a -> unit
|
type 'a printer = Format.formatter -> 'a -> unit
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,10 @@ val equal : ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a * 'b) -> ('a * 'b) -
|
||||||
|
|
||||||
val compare : ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('a * 'b) -> ('a * 'b) -> int
|
val compare : ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('a * 'b) -> ('a * 'b) -> int
|
||||||
|
|
||||||
|
val to_string : ?sep:string -> ('a -> string) -> ('b -> string) -> ('a * 'b) -> string
|
||||||
|
(** Print tuple in a string
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
type 'a printer = Format.formatter -> 'a -> unit
|
type 'a printer = Format.formatter -> 'a -> unit
|
||||||
|
|
||||||
val pp : ?sep:string -> 'a printer -> 'b printer -> ('a * 'b) printer
|
val pp : ?sep:string -> 'a printer -> 'b printer -> ('a * 'b) printer
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue