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.

2 lines
15 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these 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="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../index.html">InferStdlib</a> &#x00BB; InferStdlib__Pp</nav><h1>Module <code>InferStdlib__Pp</code></h1></header><div class="spec module" id="module-F"><a href="#module-F" class="anchor"></a><code><span class="keyword">module</span> F = Stdlib.Format</code></div><aside><p>Pretty Printing</p></aside><dl><dt class="spec type" id="type-color"><a href="#type-color" class="anchor"></a><code><span class="keyword">type</span> color</code><code> = </code><table class="variant"><tr id="type-color.Black" class="anchored"><td class="def constructor"><a href="#type-color.Black" class="anchor"></a><code>| </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>| </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>| </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>| </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>| </code><code><span class="constructor">Red</span></code></td></tr></table></dt><dd><p>Colors supported in printing</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_color"><a href="#val-compare_color" class="anchor"></a><code><span class="keyword">val</span> compare_color : <a href="index.html#type-color">color</a> <span>&#45;&gt;</span> <a href="index.html#type-color">color</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-equal_color"><a href="#val-equal_color" class="anchor"></a><code><span class="keyword">val</span> equal_color : <a href="index.html#type-color">color</a> <span>&#45;&gt;</span> <a href="index.html#type-color">color</a> <span>&#45;&gt;</span> bool</code></dt></dl><dl><dt class="spec type" id="type-colormap"><a href="#type-colormap" class="anchor"></a><code><span class="keyword">type</span> colormap</code><code> = Stdlib.Obj.t <span>&#45;&gt;</span> <a href="index.html#type-color">color</a></code></dt><dd><p>map subexpressions (as Obj.t element compared by physical equality) to colors</p></dd></dl><dl><dt class="spec type" id="type-simple_kind"><a href="#type-simple_kind" class="anchor"></a><code><span class="keyword">type</span> simple_kind</code><code> = </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>| </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>| </code><code><span class="constructor">SIM_WITH_TYP</span></code></td></tr></table></dt><dd><p>Kind of simple printing: default or with full types</p></dd></dl><dl><dt class="spec type" id="type-print_kind"><a href="#type-print_kind" class="anchor"></a><code><span class="keyword">type</span> print_kind</code><code> = </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>| </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>| </code><code><span class="constructor">HTML</span></code></td></tr></table></dt><dd><p>Kind of printing</p></dd></dl><div><div class="spec include"><div class="doc"><dl><dt class="spec value" id="val-compare_print_kind"><a href="#val-compare_print_kind" class="anchor"></a><code><span class="keyword">val</span> compare_print_kind : <a href="index.html#type-print_kind">print_kind</a> <span>&#45;&gt;</span> <a href="index.html#type-print_kind">print_kind</a> <span>&#45;&gt;</span> int</code></dt></dl></div></div></div><dl><dt class="spec value" id="val-equal_print_kind"><a href="#val-equal_print_kind" class="anchor"></a><code><span class="keyword">val</span> equal_print_kind : <a href="index.html#type-print_kind">print_kind</a> <span>&#45;&gt;</span> <a href="index.html#type-print_kind">print_kind</a> <span>&#45;&gt;</span> bool</code></dt></dl><dl><dt class="spec type" id="type-env"><a href="#type-env" class="anchor"></a><code><span class="keyword">type</span> env</code><code> = </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 : <span><span>(Stdlib.Obj.t <span>&#45;&gt;</span> Stdlib.Obj.t)</span> option</span>;</code></td><td class="doc"><p>generic object substitution</p></td></tr></table><code>}</code></dt><dd><p>Print environment threaded through all the printing functions</p></dd></dl><dl><dt class="spec value" id="val-reset_obj_sub"><a href="#val-reset_obj_sub" class="anchor"></a><code><span class="keyword">val</span> reset_obj_sub : <a href="index.html#type-env">env</a> <span>&#45;&gt;</span> <a href="index.html#type-env">env</a></code></dt><dd><p>Reset the object substitution, so that no substitution takes place</p></dd></dl><dl><dt class="spec value" id="val-set_obj_sub"><a href="#val-set_obj_sub" class="anchor"></a><code><span class="keyword">val</span> set_obj_sub : <a href="index.html#type-env">env</a> <span>&#45;&gt;</span> <span>(<span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'a</span>)</span> <span>&#45;&gt;</span> <a href="index.html#type-env">env</a></code></dt><dd><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></dd></dl><dl><dt class="spec value" id="val-colormap_red"><a href="#val-colormap_red" class="anchor"></a><code><span class="keyword">val</span> colormap_red : <a href="index.html#type-colormap">colormap</a></code></dt><dd><p>red colormap</p></dd></dl><dl><dt class="spec value" id="val-extend_colormap"><a href="#val-extend_colormap" class="anchor"></a><code><span class="keyword">val</span> extend_colormap : <a href="index.html#type-env">env</a> <span>&#45;&gt;</span> Stdlib.Obj.t <span>&#45;&gt;</span> <a href="index.html#type-color">color</a> <span>&#45;&gt;</span> <a href="index.html#type-env">env</a></code></dt><dd><p>Extend the normal colormap for the given object with the given color</p></dd></dl><dl><dt class="spec value" id="val-text"><a href="#val-text" class="anchor"></a><code><span class="keyword">val</span> text : <a href="index.html#type-env">env</a></code></dt><dd><p>Default text print environment</p></dd></dl><dl><dt class="spec value" id="val-text_break"><a href="#val-text_break" class="anchor"></a><code><span class="keyword">val</span> text_break : <a href="index.html#type-env">env</a></code></dt><dd><p>text print environment that allows line breaks</p></dd></dl><dl><dt class="spec value" id="val-html"><a href="#val-html" class="anchor"></a><code><span class="keyword">val</span> html : <a href="index.html#type-color">color</a> <span>&#45;&gt;</span> <a href="index.html#type-env">env</a></code></dt><dd><p>Default html print environment</p></dd></dl><dl><dt class="spec value" id="val-color_string"><a href="#val-color_string" class="anchor"></a><code><span class="keyword">val</span> color_string : <a href="index.html#type-color">color</a> <span>&#45;&gt;</span> string</code></dt><dd><p>string representation of colors</p></dd></dl><dl><dt class="spec value" id="val-option"><a href="#val-option" class="anchor"></a><code><span class="keyword">val</span> option : <span>(<a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-cli_args"><a href="#val-cli_args" class="anchor"></a><code><span class="keyword">val</span> cli_args : <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span>string list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>pretty print command line arguments, expanding argument files to print their contents</p></dd></dl><dl><dt class="spec value" id="val-seq"><a href="#val-seq" class="anchor"></a><code><span class="keyword">val</span> seq : <span>?&#8288;print_env:<a href="index.html#type-env">env</a></span> <span>&#45;&gt;</span> <span>?&#8288;sep:string</span> <span>&#45;&gt;</span> <span>?&#8288;sep_html:string</span> <span>&#45;&gt;</span> <span>(<a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span><span class="type-var">'a</span> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>Pretty print a sequence with <code>sep</code> followed by a space between each element. By default, <code>print_env</code> is <code>text</code>, <code>sep</code> is &quot;&quot;, and <code>sep_html</code> set to <code>sep</code>.</p></dd></dl><dl><dt class="spec value" id="val-comma_seq"><a href="#val-comma_seq" class="anchor"></a><code><span class="keyword">val</span> comma_seq : <span>?&#8288;print_env:<a href="index.html#type-env">env</a></span> <span>&#45;&gt;</span> <span>(<a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span><span class="type-var">'a</span> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>Pretty print a comma-separated sequence.</p></dd></dl><dl><dt class="spec value" id="val-semicolon_seq"><a href="#val-semicolon_seq" class="anchor"></a><code><span class="keyword">val</span> semicolon_seq : <span>?&#8288;print_env:<a href="index.html#type-env">env</a></span> <span>&#45;&gt;</span> <span>(<a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span><span class="type-var">'a</span> list</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>Pretty print a ;-separated sequence</p></dd></dl><dl><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <span>f:<span>(<span class="type-var">'a</span> <span>&#45;&gt;</span> string)</span></span> <span>&#45;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit</code></dt><dd><p>turn a &quot;to_string&quot; function into a &quot;pp_foo&quot;</p></dd></dl><dl><dt class="spec value" id="val-current_time"><a href="#val-current_time" class="anchor"></a><code><span class="keyword">val</span> current_time : <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> unit <span>&#45;&gt;</span> unit</code></dt><dd><p>Print the current time and date in a format similar to the &quot;date&quot; command</p></dd></dl><dl><dt class="spec value" id="val-elapsed_time"><a href="#val-elapsed_time" class="anchor"></a><code><span class="keyword">val</span> elapsed_time : <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> unit <span>&#45;&gt;</span> unit</code></dt><dd><p>Print the time in seconds elapsed since the beginning of the execution of the current command.</p></dd></dl><dl><dt class="spec value" id="val-pair"><a href="#val-pair" class="anchor"></a><code><span class="keyword">val</span> pair : <span>fst:<span>(<a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit)</span></span> <span>&#45;&gt;</span> <span>snd:<span>(<a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'b</span> <span>&#45;&gt;</span> unit)</span></span> <span>&#45;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span>(<span class="type-var">'a</span> * <span class="type-var">'b</span>)</span> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-in_backticks"><a href="#val-in_backticks" class="anchor"></a><code><span class="keyword">val</span> in_backticks : <span>(<a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="index.html#module-F">F</a>.formatter <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit</code></dt></dl></div></body></html>