You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
18 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferStdlib__Pp (InferStdlib.InferStdlib__Pp)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="generator" content="doc-ock-html v1.0.0-1-g1fc9bf0"/></head><body><nav id="top"><a href="../index.html">Up</a> &mdash; <span class="package">package <a href="../index.html">InferStdlib</a></span></nav><header><h1><span class="keyword">Module</span> <span class="module-path">InferStdlib__Pp</span></h1></header><div class="spec module" id="module-F"><a href="#module-F" class="anchor"></a><div class="def module"><code><span class="keyword">module </span>F = Format</code></div><div class="doc"></div></div><p>Pretty Printing</p><div class="spec type" id="type-color"><a href="#type-color" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>color</code><code></code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-color.Black" class="anchored"><td class="def constructor"><a href="#type-color.Black" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Black</span></code></td></tr><tr id="type-color.Blue" class="anchored"><td class="def constructor"><a href="#type-color.Blue" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Blue</span></code></td></tr><tr id="type-color.Green" class="anchored"><td class="def constructor"><a href="#type-color.Green" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Green</span></code></td></tr><tr id="type-color.Orange" class="anchored"><td class="def constructor"><a href="#type-color.Orange" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Orange</span></code></td></tr><tr id="type-color.Red" class="anchored"><td class="def constructor"><a href="#type-color.Red" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Red</span></code></td></tr></table><code></code></div><div class="doc"><p>Colors supported in printing</p></div></div><div class="spec include"><div class="doc"></div><details open="open"><summary><span class="def"><code><span class="keyword">include </span><span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><div class="spec val" id="val-compare_color"><a href="#val-compare_color" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_color : <a href="index.html#type-color">color</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-color">color</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-equal_color"><a href="#val-equal_color" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>equal_color : <a href="index.html#type-color">color</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-color">color</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"></div></div><div class="spec type" id="type-colormap"><a href="#type-colormap" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>colormap</code><code><span class="keyword"> = </span>Obj.t <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-color">color</a></code><code></code></div><div class="doc"><p>map subexpressions (as Obj.t element compared by physical equality) to colors</p></div></div><div class="spec type" id="type-simple_kind"><a href="#type-simple_kind" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>simple_kind</code><code></code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-simple_kind.SIM_DEFAULT" class="anchored"><td class="def constructor"><a href="#type-simple_kind.SIM_DEFAULT" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">SIM_DEFAULT</span></code></td></tr><tr id="type-simple_kind.SIM_WITH_TYP" class="anchored"><td class="def constructor"><a href="#type-simple_kind.SIM_WITH_TYP" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">SIM_WITH_TYP</span></code></td></tr></table><code></code></div><div class="doc"><p>Kind of simple printing: default or with full types</p></div></div><div class="spec type" id="type-print_kind"><a href="#type-print_kind" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>print_kind</code><code></code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-print_kind.TEXT" class="anchored"><td class="def constructor"><a href="#type-print_kind.TEXT" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">TEXT</span></code></td></tr><tr id="type-print_kind.HTML" class="anchored"><td class="def constructor"><a href="#type-print_kind.HTML" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">HTML</span></code></td></tr></table><code></code></div><div class="doc"><p>Kind of printing</p></div></div><div class="spec include"><div class="doc"></div><details open="open"><summary><span class="def"><code><span class="keyword">include </span><span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><div class="spec val" id="val-compare_print_kind"><a href="#val-compare_print_kind" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_print_kind : <a href="index.html#type-print_kind">print_kind</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-print_kind">print_kind</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-equal_print_kind"><a href="#val-equal_print_kind" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>equal_print_kind : <a href="index.html#type-print_kind">print_kind</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-print_kind">print_kind</a> <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"></div></div><div class="spec type" id="type-env"><a href="#type-env" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>env</code><code></code><code><span class="keyword"> = </span></code><code>{</code><table class="record"><tr id="type-env.opt" class="anchored"><td class="def field"><a href="#type-env.opt" class="anchor"></a><code>opt : <a href="index.html#type-simple_kind">simple_kind</a>;</code></td><td class="doc"><p>(** Current option for simple printing *)</p></td></tr><tr id="type-env.kind" class="anchored"><td class="def field"><a href="#type-env.kind" class="anchor"></a><code>kind : <a href="index.html#type-print_kind">print_kind</a>;</code></td><td class="doc"><p>(** Current kind of printing *)</p></td></tr><tr id="type-env.break_lines" class="anchored"><td class="def field"><a href="#type-env.break_lines" class="anchor"></a><code>break_lines : bool;</code></td><td class="doc"><p>(** whether to let Format add its own line breaks or not (false by default) *)</p></td></tr><tr id="type-env.cmap_norm" class="anchored"><td class="def field"><a href="#type-env.cmap_norm" class="anchor"></a><code>cmap_norm : <a href="index.html#type-colormap">colormap</a>;</code></td><td class="doc"><p>(** Current colormap for the normal part *)</p></td></tr><tr id="type-env.cmap_foot" class="anchored"><td class="def field"><a href="#type-env.cmap_foot" class="anchor"></a><code>cmap_foot : <a href="index.html#type-colormap">colormap</a>;</code></td><td class="doc"><p>(** Current colormap for the footprint part *)</p></td></tr><tr id="type-env.color" class="anchored"><td class="def field"><a href="#type-env.color" class="anchor"></a><code>color : <a href="index.html#type-color">color</a>;</code></td><td class="doc"><p>(** Current color *)</p></td></tr><tr id="type-env.obj_sub" class="anchored"><td class="def field"><a href="#type-env.obj_sub" class="anchor"></a><code>obj_sub : (Obj.t <span class="keyword">&#8209;&gt;</span> Obj.t) option;</code></td><td class="doc"><p>(** generic object substitution *)</p></td></tr></table><code>}</code><code></code></div><div class="doc"><p>Print environment threaded through all the printing functions</p></div></div><div class="spec val" id="val-reset_obj_sub"><a href="#val-reset_obj_sub" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>reset_obj_sub : <a href="index.html#type-env">env</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-env">env</a></code></div><div class="doc"><p>Reset the object substitution, so that no substitution takes place</p></div></div><div class="spec val" id="val-set_obj_sub"><a href="#val-set_obj_sub" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>set_obj_sub : <a href="index.html#type-env">env</a> <span class="keyword">&#8209;&gt;</span> (<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span>) <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-env">env</a></code></div><div class="doc"><p>Set the object substitution, which is supposed to preserve the type.
Currently only used for a map from (identifier) expressions to the program var containing them</p></div></div><div class="spec val" id="val-colormap_red"><a href="#val-colormap_red" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>colormap_red : <a href="index.html#type-colormap">colormap</a></code></div><div class="doc"><p>red colormap</p></div></div><div class="spec val" id="val-extend_colormap"><a href="#val-extend_colormap" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>extend_colormap : <a href="index.html#type-env">env</a> <span class="keyword">&#8209;&gt;</span> Obj.t <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-color">color</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-env">env</a></code></div><div class="doc"><p>Extend the normal colormap for the given object with the given color</p></div></div><div class="spec val" id="val-text"><a href="#val-text" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>text : <a href="index.html#type-env">env</a></code></div><div class="doc"><p>Default text print environment</p></div></div><div class="spec val" id="val-text_break"><a href="#val-text_break" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>text_break : <a href="index.html#type-env">env</a></code></div><div class="doc"><p>text print environment that allows line breaks</p></div></div><div class="spec val" id="val-html"><a href="#val-html" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>html : <a href="index.html#type-color">color</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-env">env</a></code></div><div class="doc"><p>Default html print environment</p></div></div><div class="spec val" id="val-color_string"><a href="#val-color_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>color_string : <a href="index.html#type-color">color</a> <span class="keyword">&#8209;&gt;</span> string</code></div><div class="doc"><p>string representation of colors</p></div></div><div class="spec val" id="val-option"><a href="#val-option" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>option : (<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> option <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-cli_args"><a href="#val-cli_args" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>cli_args : <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> string list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>pretty print command line arguments, expanding argument files to print their contents</p></div></div><div class="spec val" id="val-seq"><a href="#val-seq" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>seq : ?&#8288;print_env:<a href="index.html#type-env">env</a> <span class="keyword">&#8209;&gt;</span> ?&#8288;sep:string <span class="keyword">&#8209;&gt;</span> ?&#8288;sep_html:string <span class="keyword">&#8209;&gt;</span> (<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Pretty print a sequence with <code class="code">sep</code> followed by a space between each element. By default,
<code class="code">print_env</code> is <code class="code">text</code>, <code class="code">sep</code> is &quot;&quot;, and <code class="code">sep_html</code> set to <code class="code">sep</code>.</p></div></div><div class="spec val" id="val-comma_seq"><a href="#val-comma_seq" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>comma_seq : ?&#8288;print_env:<a href="index.html#type-env">env</a> <span class="keyword">&#8209;&gt;</span> (<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Pretty print a comma-separated sequence.</p></div></div><div class="spec val" id="val-semicolon_seq"><a href="#val-semicolon_seq" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>semicolon_seq : ?&#8288;print_env:<a href="index.html#type-env">env</a> <span class="keyword">&#8209;&gt;</span> (<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Pretty print a ;-separated sequence</p></div></div><div class="spec val" id="val-to_string"><a href="#val-to_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>to_string : f:(<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> string) <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>turn a &quot;to_string&quot; function into a &quot;pp_foo&quot;</p></div></div><div class="spec val" id="val-current_time"><a href="#val-current_time" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>current_time : <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Print the current time and date in a format similar to the &quot;date&quot; command</p></div></div><div class="spec val" id="val-elapsed_time"><a href="#val-elapsed_time" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>elapsed_time : <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> unit <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Print the time in seconds elapsed since the beginning of the execution of the current command.</p></div></div><div class="spec val" id="val-pair"><a href="#val-pair" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>pair : fst:(<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> snd:(<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'b</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> (<span class="type-var">'a</span><span class="keyword"> * </span><span class="type-var">'b</span>) <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div><div class="spec val" id="val-hashtbl"><a href="#val-hashtbl" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>hashtbl : key:(<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> value:(<a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> <span class="type-var">'b</span> <span class="keyword">&#8209;&gt;</span> unit) <span class="keyword">&#8209;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span class="keyword">&#8209;&gt;</span> (<span class="type-var">'a</span>, <span class="type-var">'b</span>) <a href="../InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Caml.Hashtbl.t <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"></div></div></body></html>