Ocaml_utils.Misc_stdlibval pp_parens_if :
bool ->
(Format.formatter -> 'a -> unit) ->
Format.formatter ->
'a ->
unitpp_parens_if bool formatter ppf arg prints formatter ppf arg, wrapping it with () if bool is true.
val pp_nested_list :
nested:bool ->
pp_element:(nested:bool -> Format.formatter -> 'a -> unit) ->
pp_sep:(Format.formatter -> unit -> unit) ->
Format.formatter ->
'a list ->
unitpp_nested_list ~nested ~pp_element ~pp_sep ppf args prints the list args with pp_element on ppf. The elements are separated by pp_sep. If ~nested is true, the list is wrapped in parens. The element printer is always called with nested:true, indicating that any inner lists are nested and need parens.
val to_string_of_print : (Format.formatter -> 'a -> unit) -> 'a -> stringto_string_of_print print produces a string conversion function from a pretty printer. This is similar but preferable to Format.asprintf "%a" when the output may be large, since to_string functions don't usually return embedded newlines.
module List : sig ... endmodule Option : sig ... endmodule Array : sig ... endmodule String : sig ... endmodule Int : sig ... endmodule Monad : sig ... endformat_as_unboxed_literal constant_literal converts constant_literal to its corresponding unboxed literal by either adding "#" in front or changing "-" to "-#".
Examples:
0.1 to #0.1 -3 to -#3 0xa.cp-1 to #0xa.cp-1
module Le_result : sig ... endThe result of a less-than-or-equal comparison
module type T1 = sig ... endmodule type T2 = sig ... endmodule Nonempty_list : sig ... endNon-empty lists
module Maybe_bounded : sig ... endA bounded non-negative integer. The possible ranges are 0 ..< n, represented by Bounded { bound = n} and 0 ..< ∞ represented by Unbounded.