Module Fmt.Dump
Formatters for inspecting OCaml values.
Formatters of this module dump OCaml value with little control over the representation but with good default box structures and, whenever possible, using OCaml syntax.
Stdlib types
val signal : int t
signal
formats an OCaml signal number as a C POSIX constant or"SIG(%d)"
the signal number is unknown.
val uchar : Stdlib.Uchar.t t
uchar
formats an OCamlUchar
.t value using only US-ASCII encoded characters according to the Unicode notational convention for code points.
val string : string t
string
ispf ppf "%S"
.
val pair : 'a t -> 'b t -> ('a * 'b) t
pair pp_fst pp_snd
formats an OCaml pair usingpp_fst
andpp_snd
for the first and second projection.
val option : 'a t -> 'a option t
option pp_v
formats an OCaml option usingpp_v
for theSome
case. No parentheses are added.
val result : ok:'a t -> error:'b t -> ('a, 'b) Stdlib.result t
result ~ok ~error
formats an OCaml result usingok
for theOk
case value anderror
for theError
case value. No parentheses are added.
val seq : 'a t -> 'a Stdlib.Seq.t t
seq pp_v
formats an OCaml sequence usingpp_v
for the sequence elements.
val hashtbl : 'a t -> 'b t -> ('a, 'b) Stdlib.Hashtbl.t t
hashtbl pp_k pp_v
formats an unspecified representation of the bindings of a hash table usingpp_k
for the keys andpp_v
for the values. If the hash table has multiple bindings for a given key, all bindings are formatted, with the most recent binding first.
Records
Sequencing
These are akin to iter
and iter_bindings
but delimit the sequences with parens
.