From 6f3cb794c45c703f45353387d4fbf8241e305d46 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 26 Jun 2014 00:10:10 +0200 Subject: [PATCH] fix CCPrint.unit, add CCPrint.silent --- core/CCPrint.ml | 4 +++- core/CCPrint.mli | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/CCPrint.ml b/core/CCPrint.ml index 5e8b9fef..bff1b12f 100644 --- a/core/CCPrint.ml +++ b/core/CCPrint.ml @@ -38,7 +38,9 @@ type 'a t = Buffer.t -> 'a -> unit (** {2 Combinators} *) -let unit buf () = () +let silent buf _ = () + +let unit buf () = Buffer.add_string buf "()" let int buf i = Buffer.add_string buf (string_of_int i) let string buf s = Buffer.add_string buf s let bool buf b = Printf.bprintf buf "%B" b diff --git a/core/CCPrint.mli b/core/CCPrint.mli index 75b282e1..270eaae6 100644 --- a/core/CCPrint.mli +++ b/core/CCPrint.mli @@ -38,7 +38,9 @@ type 'a t = Buffer.t -> 'a -> unit (** {2 Combinators} *) -val unit : unit t (* prints nothing! *) +val silent : 'a t (** prints nothing *) + +val unit : unit t val int : int t val string : string t val bool : bool t