Module Pretty_utils


module Pretty_utils: sig .. end

pretty-printing to a string



val sfprintf : ('a, Format.formatter, unit, string) Pervasives.format4 -> 'a
similar as Format.sprintf, but %a are allowed in the formatting string

separators


val no_sep : (unit, Format.formatter, unit) Pervasives.format
do nothing
val space_sep : (unit, Format.formatter, unit) Pervasives.format
a breakable space
val nl_sep : (unit, Format.formatter, unit) Pervasives.format
forces a newline
val pp_print_string_fill : Format.formatter -> string -> unit
transforms every space in a string in breakable spaces.
val open_box : (unit, Format.formatter, unit) Pervasives.format
opens a new formatting box.
val close_box : (unit, Format.formatter, unit) Pervasives.format
close a formatting box.
val escape_underscores : string -> string

pretty printers for standard types


type sformat = (unit, Format.formatter, unit) Pervasives.format 
type 'a formatter = Format.formatter -> 'a -> unit 
type ('a, 'b) formatter2 = Format.formatter -> 'a -> 'b -> unit 
val pp_list : ?pre:sformat ->
?sep:sformat ->
?suf:sformat ->
'a formatter -> 'a list formatter
pretty prints a list. The optional arguments stands for
val pp_array : ?pre:sformat ->
?sep:sformat ->
?suf:sformat ->
(int, 'a) formatter2 -> 'a array formatter
pretty prints an array. The optional arguments stands for
val pp_opt : ?pre:sformat ->
?suf:sformat ->
'a formatter -> 'a option formatter
pretty-prints an optional value. Prefix and suffix default to nothing. Nothing is printed if the option is None.
val pp_cond : ?pr_false:sformat ->
bool -> sformat formatter
pp_cond cond f s pretty-prints s if cond is true and the optional pr_false, which defaults to nothing, otherwise
val pp_flowlist : ?left:string ->
?sep:string ->
?right:string -> 'a formatter -> 'a list formatter
val pp_blocklist : ?left:string ->
?right:string -> 'a formatter -> 'a list formatter
val pp_open_block : Format.formatter -> ('a, Format.formatter, unit) Pervasives.format -> 'a
val pp_close_block : Format.formatter -> ('a, Format.formatter, unit) Pervasives.format -> 'a