diff options
author | Daniel Bünzli <daniel.buenzli@erratique.ch> | 2018-08-06 18:32:53 +0200 |
---|---|---|
committer | Daniel Bünzli <daniel.buenzli@erratique.ch> | 2018-08-08 11:45:35 +0200 |
commit | f9c97d16c0cc85d082678f37026d8473b68561a2 (patch) | |
tree | e5704752adaed6c2e3a44b83e1ed7c4c06042d86 /stdlib/format.mli | |
parent | 1798999b6543dcabfe9567e827851b5787cbc65a (diff) | |
download | ocaml-f9c97d16c0cc85d082678f37026d8473b68561a2.tar.gz |
Add Format.pp_print_option.
Diffstat (limited to 'stdlib/format.mli')
-rw-r--r-- | stdlib/format.mli | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/stdlib/format.mli b/stdlib/format.mli index 2af7f47c65..0fd986119b 100644 --- a/stdlib/format.mli +++ b/stdlib/format.mli @@ -949,6 +949,15 @@ val pp_print_text : formatter -> string -> unit @since 4.02.0 *) +val pp_print_option : + ?none:(formatter -> unit -> unit) -> + (formatter -> 'a -> unit) -> (formatter -> 'a option -> unit) +(** [pp_print_option ?none pp_v ppf o] prints [o] on [ppf] + using [pp_v] if [o] is [Some v] and [none] if it is [None]. [none] + prints nothing by default. + + @since 4.08 *) + val pp_print_result : ok:(formatter -> 'a -> unit) -> error:(formatter -> 'e -> unit) -> formatter -> ('a, 'e) result -> unit |