Module Fmt.Dump
Contents
Instructions: Use this module in your project
In the IDE (CLion, Visual Studio Code, Xcode, etc.) you use for your DkSDK project:
Add the following to your project's
dependencies/CMakeLists.txt:DkSDKProject_DeclareAvailable(fmt CONSTRAINT "= 0.9.0+dune" FINDLIBS fmt fmt.cli fmt.top fmt.tty) DkSDKProject_MakeAvailable(fmt)Add the
Findlib::fmtlibrary to any desired targets insrc/*/CMakeLists.txt:target_link_libraries(YourPackage_YourLibraryName # ... existing libraries, if any ... Findlib::fmt)Click your IDE's
Buildbutton
Not using DkSDK?
FIRST, do one or all of the following:
Run:
opam install fmt.0.9.0+duneEdit your
dune-projectand add:(package (name YourExistingPackage) (depends ; ... existing dependenices ... (fmt (>= 0.9.0+dune))))Then run:
dune build *.opam # if this fails, run: dune buildEdit your
<package>.opamfile and add:depends: [ # ... existing dependencies ... "fmt" {>= "0.9.0+dune"} ]Then run:
opam install . --deps-only
FINALLY, add the fmt library to any desired (library)and/or (executable) targets in your **/dune files:
(library
(name YourLibrary)
; ... existing library options ...
(libraries
; ... existing libraries ...
fmt))
(executable
(name YourExecutable)
; ... existing executable options ...
(libraries
; ... existing libraries ...
fmt))Stdlib types
valsignal : ``intt
signal formats an OCaml signal
number as a C POSIX
constant
or "SIG(%d)" the signal number is unknown.
valuchar :Stdlib.Uchar.tt
uchar formats an OCaml Uchar.t value using only US-ASCII encoded
characters according to the Unicode notational
convention for code
points.
valstring : ``stringt
string is pf ppf "%S".
pair pp_fst pp_snd formats an OCaml pair using pp_fst and pp_snd
for the first and second projection.
option pp_v formats an OCaml option using pp_v for the Some case.
No parentheses are added.
result ~ok ~error formats an OCaml result using ok for the Ok case
value and error for the Error case value. No parentheses are added.
valseq :'at->'aStdlib.Seq.tt
seq pp_v formats an OCaml sequence using pp_v for the sequence
elements.
valhashtbl :'at->'bt->``('a,'b)``Stdlib.Hashtbl.tt
hashtbl pp_k pp_v formats an unspecified representation of the
bindings of a hash table using pp_k for the keys and pp_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.
valqueue :'at->'aStdlib.Queue.tt
queue pp_v formats an unspecified representation of an OCaml queue
using pp_v to format its elements, in least recently added order.
valstack :'at->'aStdlib.Stack.tt
stack pp_v formats an unspecified representation of an OCaml stack
using pp_v to format its elements in top to bottom order.
Records
field ~label l prj pp_v pretty prints a named field using label
(defaults to styled `Yellow string) for the label, and
using prj pp_v for the field value.
record fields pretty-prints a value using the concatenation of
fields, separated by ";@,", framed in a vertical box and surrounded
by braces.
Sequencing
These are akin to iter and
iter_bindings but delimit the sequences with
parens.
iter iter pp_name pp_elt formats an unspecified representation of the
iterations of iter over a value using pp_elt. The iteration is named
by pp_name.
iter_bindings ~sep iter pp_name pp_k pp_v formats an unspecified
representation of the iterations of iter over a value using pp_k and
pp_v. The iteration is named by pp_name.
