B00_std.FmtTextual formatters.
Helpers for dealing with Format.
val stdout : Format.formatterstdout outputs to standard output.
val stderr : Format.formatterstderr outputs to standard error.
val pf : Format.formatter -> ('a, Format.formatter, unit) format -> 'apf is Format.fprintf.
val pr : ('a, Format.formatter, unit) format -> 'apf is Format.printf.
val epr : ('a, Format.formatter, unit) format -> 'aepr is Format.eprintf.
val str : ('a, Format.formatter, unit, string) format4 -> 'astr is Format.asprintf.
val kpf : (Format.formatter -> 'a) -> Format.formatter -> ('b, Format.formatter, unit, 'a) format4 -> 'bkpf is Format.kfprintf.
val kstr : (string -> 'a) -> ('b, Format.formatter, unit, 'a) format4 -> 'bkstr is Format.kasprintf.
val failwith : ('b, Format.formatter, unit, 'a) format4 -> 'bfailwith fmt ... is kstr failwith fmt ...
val failwith_notrace : ('b, Format.formatter, unit, 'a) format4 -> 'bfailwith_notrace is like failwith but Failure is raised with raise_notrace.
val invalid_arg : ('b, Format.formatter, unit, 'a) format4 -> 'binvalid_arg fmt ... is kstr invalid_arg fmt ...
val error : ('b, Format.formatter, unit, ('a, string) result) format4 -> 'berror fmt ... is kstr (fun s -> Error s) fmt ...
type 'a t = Format.formatter -> 'a -> unitThe type for formatter of values of type 'a.
val flush : 'a tflush has the effect of Format.pp_print_flush.
val flush_nl : 'a tflush_nl has the effect of Format.pp_print_newline.
val nop : 'a tnop formats nothing.
val any : (unit, Format.formatter, unit) format -> 'a tany fmt formats any value with fmt.
val cut : 'a tcut has the effect of Format.pp_print_cut.
val sp : 'a tsp has the effect of Format.pp_print_space.
val sps : int -> 'a tsps n has the effect of Format.pp_print_break n 0.
iter ~sep iter pp_elt formats the iterations of iter over a value using pp_elt. Iterations are separated by sep (defaults to cut).
iter_bindings ~sep iter pp_binding formats the iterations of iter over a value using pp_binding. Iterations are separated by sep (defaults to cut).
concat ~sep pps concatenates the formatters pps separating them with sep (defaults to cut).
box ~indent pp ppf wraps pp in a horizontal or vertical box. Break hints that lead to a new line add indent to the current indentation (defaults to 0).
hbox is like box but is a horizontal box: the line is not split in this box (but may be in sub-boxes).
vbox is like box but is a vertical box: every break hint leads to a new line which adds indent to the current indentation (default to 0).
quote ~mark pp_v ppf is pf "@[<1>@<1>%s%a@<1>%s@]" mark pp_v mark, mark defaults to "\"", it is always counted as spanning as single column (this allows for UTF-8 encoded marks).
field ~label ~sep l prj pp_v pretty prints a labelled field value as pf "@[<1>%a%a%a@]" label l sep () (using prj pp_v). label defaults to tty_string [`Yellow] and sep to any ":@ ".
record ~sep fields pretty-prints a value using the concatenation of fields, separated by sep (defaults to cut) and framed in a vertical box.
Formatters for structures give full control to the client over the formatting process and do not wrap the formatted structures with boxes.
val bool : bool tbool is Format.pp_print_bool.
val int : int tint is Format.pp_print_int.
val int32 : int32 tint32 is pf ppf "%ld".
val int64 : int64 tint64 is pf ppf "%Ld".
val float : float tfloat is pf ppf "%g".
val char : char tchar is Format.pp_print_char.
val string : string tstring is Format.pp_print_string.
val sys_signal : int tsys_signal formats an OCaml signal number as a C POSIX constant or "SIG(%d)" if the signal number is unknown.
val backtrace : Printexc.raw_backtrace tbacktrace formats a backtrace.
val exn : exn texn formats an exception.
val exn_backtrace : (exn * Printexc.raw_backtrace) texn_backtrace formats an exception backtrace.
pair ~sep pp_fst pp_snd formats a pair. The first and second projection are formatted using pp_fst and pp_snd and are separated by sep (defaults to cut).
option ~none pp_v formats an option. The Some case uses pp_v and None uses none (defaults to nop).
val none : unit tnone is any "<none>".
val si_size : scale:int -> string -> int tsi_size ~scale unit formats a non negative integer representing unit unit at scale 10scale * 3, depending on its magnitude, using power of 3 SI prefixes (i.e. all of them except deca, hector, deci and centi). Only US-ASCII characters are used, µ (10-6) is written using u.
scale indicates the scale 10scale * 3 an integer represents, for example -1 for munit (10-3), 0 for unit (100), 1 for kunit (103); it must be in the range [-8;8] or Invalid_argument is raised.
Except at the maximal yotta scale always tries to show three digits of data with trailing fractional zeros omited. Rounds towards positive infinity (over approximates).
val byte_size : int tbyte_size is si_size ~scale:0 "B".
val uint64_ns_span : int64 tuint64_ns_span formats an unsigned nanosecond time span according to its magnitude using SI prefixes on seconds and accepted non-SI units. Years are counted in Julian years (365.25 SI-accepted days) as defined by the International Astronomical Union (IAU). Only US-ASCII characters are used (us is used for µs).
val text : string ttext is Format.pp_print_text.
val lines : string tlines formats lines by replacing newlines ('\n') in the string with calls to Format.pp_force_newline.
val truncated : max:int -> string ttruncated ~max formats a string using at most max characters. If the string doesn't fit, it is truncated and ended with three consecutive dots which do count towards max.
and_enum ~empty pp_v ppf l formats l according to its length.
0, formats empty (defaults to nop).1, formats the element with pp_v.2, formats "%a and %a" with the list elementsn, formats "%a, ... and %a" with the list elementsor_enum is like and_enum but uses "or" instead of "and".
unknown ~kind pp_v ~hint (v, hints) formats unknown followed by a space and hint pp_v hints if hints is non-empty.
val set_tty_styling_cap : Tty.cap -> unitset_tty_styling_cap c sets the global styling capabilities to c. Affects the output of tty_str and tty.
val tty_styling_cap : unit -> Tty.captty_styling_cap () is the global styling capability.
tty_string styles ppf s prints s on ppf according to styles and the value of tty_styling_cap.
tty styles pp_v ppf v prints v with pp_v on ppf according to styles and the value of tty_styling_cap.