mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
CCPair.print
This commit is contained in:
parent
67824b333a
commit
25139d7bb5
2 changed files with 7 additions and 0 deletions
|
|
@ -64,6 +64,10 @@ let compare f g (x1,y1) (x2,y2) =
|
|||
if c <> 0 then c else g y1 y2
|
||||
|
||||
type 'a printer = Buffer.t -> 'a -> unit
|
||||
type 'a formatter = Format.formatter -> 'a -> unit
|
||||
|
||||
let pp pp_x pp_y buf (x,y) =
|
||||
Printf.bprintf buf "(%a, %a)" pp_x x pp_y y
|
||||
|
||||
let print pa pb fmt (x,y) =
|
||||
Format.fprintf fmt "(%a, %a)" pa x pb y
|
||||
|
|
|
|||
|
|
@ -83,5 +83,8 @@ 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
|
||||
|
||||
type 'a printer = Buffer.t -> 'a -> unit
|
||||
type 'a formatter = Format.formatter -> 'a -> unit
|
||||
|
||||
val pp : 'a printer -> 'b printer -> ('a*'b) printer
|
||||
|
||||
val print : 'a formatter -> 'b formatter -> ('a*'b) formatter
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue