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.
Base types formatters
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.
Polymorphic type formatters
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) Result.result t
result ~ok ~error
formats an OCaml result usingok
for theOk
case value anderror
for theError
case value. No parentheses are added.
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.
val queue : 'a t -> 'a Stdlib.Queue.t t
queue pp_v
formats an unspecified representation of an OCaml queue usingpp_v
to format its elements, in least recently added order.
val stack : 'a t -> 'a Stdlib.Stack.t t
stack pp_v
formats an unspecified representation of an OCaml stack usingpp_v
to format its elements in top to bottom order.