diff --git a/src/core/CCFormat.ml b/src/core/CCFormat.ml index e1ff197a..a4ac12f0 100644 --- a/src/core/CCFormat.ml +++ b/src/core/CCFormat.ml @@ -127,6 +127,8 @@ let hbox pp out x = let of_to_string f out x = Format.pp_print_string out (f x) +let exn = of_to_string Printexc.to_string + let const pp x out () = pp out x let some pp out = function diff --git a/src/core/CCFormat.mli b/src/core/CCFormat.mli index 3fdb0b27..f4a0198f 100644 --- a/src/core/CCFormat.mli +++ b/src/core/CCFormat.mli @@ -29,6 +29,10 @@ val bool : bool printer val float3 : float printer (* 3 digits after . *) val float : float printer +val exn : exn printer +(** Printer using {!Printexc.to_string}. + @since NEXT_RELEASE *) + val newline : unit printer (** Force newline (see {!Format.pp_force_newline}). @since 1.2 *)