Module Ocaml_utils.Misc_stdlib

val pp_parens_if : bool -> (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit

pp_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 -> unit

pp_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 -> string

to_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 ... end
module Option : sig ... end
module Array : sig ... end
module String : sig ... end
module Int : sig ... end
module Monad : sig ... end
val format_as_unboxed_literal : string -> string

format_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 ... end

The result of a less-than-or-equal comparison

type (_, _) eq =
  1. | Refl : ('a, 'a) eq
module type T1 = sig ... end
module type T2 = sig ... end
module Nonempty_list : sig ... end

Non-empty lists

module Maybe_bounded : sig ... end

A bounded non-negative integer. The possible ranges are 0 ..< n, represented by Bounded { bound = n} and 0 ..< ∞ represented by Unbounded.