mirror of
https://github.com/c-cube/linol.git
synced 2025-12-07 11:45:43 -05:00
7 lines
13 KiB
HTML
7 lines
13 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Dump (fmt.Fmt.Dump)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.0.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../index.html">Index</a> » <a href="../../index.html">fmt</a> » <a href="../index.html">Fmt</a> » Dump</nav><header class="odoc-preamble"><h1>Module <code><span>Fmt.Dump</span></code></h1><p>Formatters for inspecting OCaml values.</p><p>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.</p></header><div class="odoc-tocs"><nav class="odoc-toc odoc-local-toc"><ul><li><a href="#stdlib">Stdlib types</a></li><li><a href="#record">Records</a></li><li><a href="#seq">Sequencing</a></li></ul></nav></div><div class="odoc-content"><h2 id="stdlib"><a href="#stdlib" class="anchor"></a>Stdlib types</h2><div class="odoc-spec"><div class="spec value anchored" id="val-signal"><a href="#val-signal" class="anchor"></a><code><span><span class="keyword">val</span> signal : <span>int <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>signal</code> formats an OCaml <span class="xref-unresolved" title="Sys.sigabrt">signal number</span> as a C POSIX <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html">constant</a> or <code>"SIG(%d)"</code> the signal number is unknown.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-uchar"><a href="#val-uchar" class="anchor"></a><code><span><span class="keyword">val</span> uchar : <span><a href="../../../ocaml/Stdlib/Uchar/index.html#type-t">Stdlib.Uchar.t</a> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>uchar</code> formats an OCaml <code>Uchar.t</code> value using only US-ASCII encoded characters according to the Unicode <a href="http://www.unicode.org/versions/latest/appA.pdf">notational convention</a> for code points.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-string"><a href="#val-string" class="anchor"></a><code><span><span class="keyword">val</span> string : <span>string <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>string</code> is <code>pf ppf "%S"</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pair"><a href="#val-pair" class="anchor"></a><code><span><span class="keyword">val</span> pair : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'b</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span>(<span class="type-var">'a</span> * <span class="type-var">'b</span>)</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>pair pp_fst pp_snd</code> formats an OCaml pair using <code>pp_fst</code> and <code>pp_snd</code> for the first and second projection.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-option"><a href="#val-option" class="anchor"></a><code><span><span class="keyword">val</span> option : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> option</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>option pp_v</code> formats an OCaml option using <code>pp_v</code> for the <code>Some</code> case. No parentheses are added.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-result"><a href="#val-result" class="anchor"></a><code><span><span class="keyword">val</span> result : <span><span class="label">ok</span>:<span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span class="label">error</span>:<span><span class="type-var">'b</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span>(<span class="type-var">'a</span>, <span class="type-var">'b</span>)</span> <a href="../../../ocaml/Stdlib/index.html#type-result">result</a></span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>result ~ok ~error</code> formats an OCaml result using <code>ok</code> for the <code>Ok</code> case value and <code>error</code> for the <code>Error</code> case value. No parentheses are added.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-list"><a href="#val-list" class="anchor"></a><code><span><span class="keyword">val</span> list : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> list</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>list pp_v</code> formats an OCaml list using <code>pp_v</code> for the list elements.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-array"><a href="#val-array" class="anchor"></a><code><span><span class="keyword">val</span> array : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> array</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>array pp_v</code> formats an OCaml array using <code>pp_v</code> for the array elements.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-seq"><a href="#val-seq" class="anchor"></a><code><span><span class="keyword">val</span> seq : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="../../../ocaml/Stdlib/Seq/index.html#type-t">Stdlib.Seq.t</a></span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>seq pp_v</code> formats an OCaml sequence using <code>pp_v</code> for the sequence elements.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-hashtbl"><a href="#val-hashtbl" class="anchor"></a><code><span><span class="keyword">val</span> hashtbl : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'b</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span>(<span class="type-var">'a</span>, <span class="type-var">'b</span>)</span> <a href="../../../ocaml/Stdlib/Hashtbl/index.html#type-t">Stdlib.Hashtbl.t</a></span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>hashtbl pp_k pp_v</code> formats an unspecified representation of the bindings of a hash table using <code>pp_k</code> for the keys and <code>pp_v</code> for the values. If the hash table has multiple bindings for a given key, all bindings are formatted, with the most recent binding first.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-queue"><a href="#val-queue" class="anchor"></a><code><span><span class="keyword">val</span> queue : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="../../../ocaml/Stdlib/Queue/index.html#type-t">Stdlib.Queue.t</a></span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>queue pp_v</code> formats an unspecified representation of an OCaml queue using <code>pp_v</code> to format its elements, in least recently added order.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stack"><a href="#val-stack" class="anchor"></a><code><span><span class="keyword">val</span> stack : <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="../../../ocaml/Stdlib/Stack/index.html#type-t">Stdlib.Stack.t</a></span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>stack pp_v</code> formats an unspecified representation of an OCaml stack using <code>pp_v</code> to format its elements in top to bottom order.</p></div></div><h2 id="record"><a href="#record" class="anchor"></a>Records</h2><div class="odoc-spec"><div class="spec value anchored" id="val-field"><a href="#val-field" class="anchor"></a><code><span><span class="keyword">val</span> field : <span><span class="optlabel">?label</span>:<span>string <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span>string <span class="arrow">-></span></span> <span><span>(<span><span class="type-var">'b</span> <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span class="type-var">'b</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>field ~label l prj pp_v</code> pretty prints a named field using <code>label</code> (defaults to <code>styled `Yellow string</code>) for the label, and <code>using prj pp_v</code> for the field value.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-record"><a href="#val-record" class="anchor"></a><code><span><span class="keyword">val</span> record : <span><span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> list</span> <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>record fields</code> pretty-prints a value using the concatenation of <code>fields</code>, separated by <code>";@,"</code>, framed in a vertical box and surrounded by <a href="../index.html#val-braces"><code>braces</code></a>.</p></div></div><h2 id="seq"><a href="#seq" class="anchor"></a>Sequencing</h2><p>These are akin to <a href="#val-iter"><code>iter</code></a> and <a href="#val-iter_bindings"><code>iter_bindings</code></a> but delimit the sequences with <a href="../index.html#val-parens"><code>parens</code></a>.</p><div class="odoc-spec"><div class="spec value anchored" id="val-iter"><a href="#val-iter" class="anchor"></a><code><span><span class="keyword">val</span> iter : <span><span>(<span><span>(<span><span class="type-var">'a</span> <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> <span><span class="type-var">'b</span> <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> <span><span><span class="type-var">'b</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span><span class="type-var">'b</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>iter iter pp_name pp_elt</code> formats an unspecified representation of the iterations of <code>iter</code> over a value using <code>pp_elt</code>. The iteration is named by <code>pp_name</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-iter_bindings"><a href="#val-iter_bindings" class="anchor"></a><code><span><span class="keyword">val</span> iter_bindings :
|
||
<span><span>(<span><span>(<span><span class="type-var">'a</span> <span class="arrow">-></span></span> <span><span class="type-var">'b</span> <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> <span><span class="type-var">'c</span> <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span>
|
||
<span><span><span class="type-var">'c</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span>
|
||
<span><span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span>
|
||
<span><span><span class="type-var">'b</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span>
|
||
<span><span class="type-var">'c</span> <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>iter_bindings ~sep iter pp_name pp_k pp_v</code> formats an unspecified representation of the iterations of <code>iter</code> over a value using <code>pp_k</code> and <code>pp_v</code>. The iteration is named by <code>pp_name</code>.</p></div></div></div></body></html>
|