Module Logs.Tag
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(logs CONSTRAINT "= 0.7.0+dune2" FINDLIBS logs logs.cli logs.fmt logs.lwt logs.threaded logs.top) DkSDKProject_MakeAvailable(logs)Add the
Findlib::logslibrary to any desired targets insrc/*/CMakeLists.txt:target_link_libraries(YourPackage_YourLibraryName # ... existing libraries, if any ... Findlib::logs)Click your IDE's
Buildbutton
Not using DkSDK?
FIRST, do one or all of the following:
Run:
opam install logs.0.7.0+dune2Edit your
dune-projectand add:(package (name YourExistingPackage) (depends ; ... existing dependenices ... (logs (>= 0.7.0+dune2))))Then run:
dune build *.opam # if this fails, run: dune buildEdit your
<package>.opamfile and add:depends: [ # ... existing dependencies ... "logs" {>= "0.7.0+dune2"} ]Then run:
opam install . --deps-only
FINALLY, add the logs library to any desired (library)and/or (executable) targets in your **/dune files:
(library
(name YourLibrary)
; ... existing library options ...
(libraries
; ... existing libraries ...
logs))
(executable
(name YourExecutable)
; ... existing executable options ...
(libraries
; ... existing libraries ...
logs))Tag definitions
type``'a def
The type for tag definitions. The type 'a is the type of the tag. The
definition specifies a name for the tag, a pretty-printer for the type
of the tag and a documentation string. See def.
valdef : ``?doc:string->``string->``(Stdlib.Format.formatter->'a->unit)``->'adef
def ~doc name pp is a tag definition. name is the name of the tag,
it doesn't need to be unique. pp is a printer for the type of the tag.
doc is a documentation string describing the tag (defaults to
"undocumented").
valname :'adef->string
name d is d's name.
valdoc :'adef->string
doc d is d's documentation string.
valprinter :'adef->Stdlib.Format.formatter->'a->unit
printer d is d's type pretty-printer.
valpp_def :Stdlib.Format.formatter->'adef->unit
pp_def ppf d prints an unspecified representation of d on ppf.
vallist : ``unit->def_elist
tag_list () is the list of currently existing tag definitions.
Tags
valpp :Stdlib.Format.formatter->t->unit
pp ppf t prints an unspecified representation of t on ppf.
Tag sets
typeset
The type for tag sets. A tag set contains at most one tag per tag definition.
valempty :set
empty is the empty set.
valis_empty :set->bool
is_empty s is true iff s is empty.
add d v s is s with the tag (V (d, v)) added. If there was a tag
with definition d in s it is replaced.
get d s is like find d s but
-
raises Invalid_argument
if there is no tag with definition
dins.
fold f s acc is the result of folding f over the tags of s
starting with acc.
valpp_set :Stdlib.Format.formatter->set->unit
pp_set ppf s prints an unspecified representation of s on ppf.
