mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
deploy: ff2d1d3cbc
This commit is contained in:
parent
ad40d3d74f
commit
6eba9c4721
8 changed files with 14 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CCOrd (containers.CCOrd)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.3"/><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">containers</a> » CCOrd</nav><h1>Module <code>CCOrd</code></h1><h2 id="comparisons"><a href="#comparisons" class="anchor"></a>Comparisons</h2><nav class="toc"><ul><li><a href="#lexicographic-combination">Lexicographic Combination</a></li></ul></nav></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> <span>'a t</span></code><code> = <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <span>-></span> int</code></dt><dd><p>Comparison (total ordering) between two elements, that returns an int.</p></dd></dl><dl><dt class="spec value" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span class="keyword">val</span> compare : <span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span></code></dt><dd><p>Polymorphic "magic" comparison.</p></dd></dl><dl><dt class="spec value" id="val-opp"><a href="#val-opp" class="anchor"></a><code><span class="keyword">val</span> opp : <span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span> <span>-></span> <span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span></code></dt><dd><p>Opposite order.</p></dd></dl><dl><dt class="spec value" id="val-equiv"><a href="#val-equiv" class="anchor"></a><code><span class="keyword">val</span> equiv : int <span>-></span> int <span>-></span> bool</code></dt><dd><p>Returns <code>true</code> iff the two comparison results are the same.</p></dd></dl><dl><dt class="spec value" id="val-int"><a href="#val-int" class="anchor"></a><code><span class="keyword">val</span> int : <span>int <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-string"><a href="#val-string" class="anchor"></a><code><span class="keyword">val</span> string : <span>string <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-bool"><a href="#val-bool" class="anchor"></a><code><span class="keyword">val</span> bool : <span>bool <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-float"><a href="#val-float" class="anchor"></a><code><span class="keyword">val</span> float : <span>float <a href="index.html#type-t">t</a></span></code></dt></dl><section><header><h3 id="lexicographic-combination"><a href="#lexicographic-combination" class="anchor"></a>Lexicographic Combination</h3></header><dl><dt class="spec value" id="val-(<?>)"><a href="#val-(<?>)" class="anchor"></a><code><span class="keyword">val</span> (<?>) : int <span>-></span> <span>(<span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span> * <span class="type-var">'a</span> * <span class="type-var">'a</span>)</span> <span>-></span> int</code></dt><dd><p><code>c1 <?> (ord, x, y)</code> returns the same as <code>c1</code> if <code>c1</code> is not <code>0</code>; otherwise it uses <code>ord</code> to compare the two values <code>x</code> and <code>y</code>, of type <code>'a</code>.</p><p>Example:</p><pre><code class="ml">CCInt.compare 1 3
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CCOrd (containers.CCOrd)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.3"/><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">containers</a> » CCOrd</nav><h1>Module <code>CCOrd</code></h1><h2 id="comparisons"><a href="#comparisons" class="anchor"></a>Comparisons</h2><nav class="toc"><ul><li><a href="#lexicographic-combination">Lexicographic Combination</a></li></ul></nav></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> <span>'a t</span></code><code> = <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <span>-></span> int</code></dt><dd><p>Comparison (total ordering) between two elements, that returns an int.</p></dd></dl><dl><dt class="spec value" id="val-poly"><a href="#val-poly" class="anchor"></a><code><span class="keyword">val</span> poly : <span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span></code></dt><dd><p>Polymorphic "magic" comparison. Use with care, as it will fail on some types.</p><dl><dt>since</dt><dd>NEXT_RELEASE</dd></dl></dd></dl><dl><dt class="spec value" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span class="keyword">val</span> compare : <span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span></code></dt><dd><p>Polymorphic "magic" comparison.</p><dl><dt>deprecated</dt><dd><p>since NEXT_RELEASE in favor of <a href="index.html#val-poly"><code>poly</code></a>. The reason is that <code>compare</code> is easily shadowed, can shadow other comparators, and is just generally not very descriptive.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-opp"><a href="#val-opp" class="anchor"></a><code><span class="keyword">val</span> opp : <span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span> <span>-></span> <span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span></code></dt><dd><p>Opposite order. For example, <code>opp cmp a b < 0</code> iff <code>cmp b a > 0</code>. This can be used to sort values in the opposite order, among other things.</p></dd></dl><dl><dt class="spec value" id="val-equiv"><a href="#val-equiv" class="anchor"></a><code><span class="keyword">val</span> equiv : int <span>-></span> int <span>-></span> bool</code></dt><dd><p>Returns <code>true</code> iff the two comparison results are the same.</p></dd></dl><dl><dt class="spec value" id="val-int"><a href="#val-int" class="anchor"></a><code><span class="keyword">val</span> int : <span>int <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-string"><a href="#val-string" class="anchor"></a><code><span class="keyword">val</span> string : <span>string <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-bool"><a href="#val-bool" class="anchor"></a><code><span class="keyword">val</span> bool : <span>bool <a href="index.html#type-t">t</a></span></code></dt><dt class="spec value" id="val-float"><a href="#val-float" class="anchor"></a><code><span class="keyword">val</span> float : <span>float <a href="index.html#type-t">t</a></span></code></dt></dl><section><header><h3 id="lexicographic-combination"><a href="#lexicographic-combination" class="anchor"></a>Lexicographic Combination</h3></header><dl><dt class="spec value" id="val-(<?>)"><a href="#val-(<?>)" class="anchor"></a><code><span class="keyword">val</span> (<?>) : int <span>-></span> <span>(<span><span class="type-var">'a</span> <a href="index.html#type-t">t</a></span> * <span class="type-var">'a</span> * <span class="type-var">'a</span>)</span> <span>-></span> int</code></dt><dd><p><code>c1 <?> (ord, x, y)</code> returns the same as <code>c1</code> if <code>c1</code> is not <code>0</code>; otherwise it uses <code>ord</code> to compare the two values <code>x</code> and <code>y</code>, of type <code>'a</code>.</p><p>Example:</p><pre><code class="ml">CCInt.compare 1 3
|
||||
<?> (String.compare, "a", "b")
|
||||
<?> (CCBool.compare, true, false)</code></pre><p>Same example, using only CCOrd::</p><pre><code class="ml">CCOrd.(int 1 3
|
||||
<?> (string, "a", "b")
|
||||
|
|
|
|||
2
dev/containers/CCParse/Debug_/index.html
Normal file
2
dev/containers/CCParse/Debug_/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Debug_ (containers.CCParse.Debug_)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.3"/><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">containers</a> » <a href="../index.html">CCParse</a> » Debug_</nav><h1>Module <code>CCParse.Debug_</code></h1><p>Debugging utils. <b>EXPERIMENTAL</b></p><dl><dt>since</dt><dd>NEXT_RELEASE</dd></dl></header><dl><dt class="spec value" id="val-trace_fail"><a href="#val-trace_fail" class="anchor"></a><code><span class="keyword">val</span> trace_fail : string <span>-></span> <span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span>-></span> <span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span></code></dt><dd><p><code>trace_fail name p</code> behaves like <code>p</code>, but prints the error message of <code>p</code> on stderr whenever <code>p</code> fails.</p><dl><dt>parameter name</dt><dd><p>used as a prefix of all trace messages.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-trace_success"><a href="#val-trace_success" class="anchor"></a><code><span class="keyword">val</span> trace_success : string <span>-></span> <span>print:<span>(<span class="type-var">'a</span> <span>-></span> string)</span></span> <span>-></span> <span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span>-></span> <span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span></code></dt><dd><p><code>trace_success name ~print p</code> behaves like <code>p</code>, but prints successful runs of <code>p</code> using <code>print</code>.</p></dd></dl><dl><dt class="spec value" id="val-trace_success_or_fail"><a href="#val-trace_success_or_fail" class="anchor"></a><code><span class="keyword">val</span> trace_success_or_fail : string <span>-></span> <span>print:<span>(<span class="type-var">'a</span> <span>-></span> string)</span></span> <span>-></span> <span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span> <span>-></span> <span><span class="type-var">'a</span> <a href="../index.html#type-t">t</a></span></code></dt><dd><p>Trace both error or success</p></dd></dl></div></body></html>
|
||||
2
dev/containers/CCParse/Error/index.html
Normal file
2
dev/containers/CCParse/Error/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Error (containers.CCParse.Error)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.3"/><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">containers</a> » <a href="../index.html">CCParse</a> » Error</nav><h1>Module <code>CCParse.Error</code></h1><h3 id="errors"><a href="#errors" class="anchor"></a>Errors</h3><dl><dt>since</dt><dd>NEXT_RELEASE</dd></dl></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt><dd><p>A parse error.</p><dl><dt>since</dt><dd>NEXT_RELEASE</dd></dl></dd></dl><dl><dt class="spec value" id="val-position"><a href="#val-position" class="anchor"></a><code><span class="keyword">val</span> position : <a href="index.html#type-t">t</a> <span>-></span> <a href="../index.html#type-position">position</a></code></dt><dd><p>Returns position of the error</p></dd></dl><dl><dt class="spec value" id="val-line_and_column"><a href="#val-line_and_column" class="anchor"></a><code><span class="keyword">val</span> line_and_column : <a href="index.html#type-t">t</a> <span>-></span> int * int</code></dt><dd><p>Line and column numbers of the error position.</p></dd></dl><dl><dt class="spec value" id="val-msg"><a href="#val-msg" class="anchor"></a><code><span class="keyword">val</span> msg : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Prints the error</p></dd></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p>Pretty prints the error</p></dd></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
2
dev/containers/CCParse/Position/index.html
Normal file
2
dev/containers/CCParse/Position/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Position (containers.CCParse.Position)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.3"/><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">containers</a> » <a href="../index.html">CCParse</a> » Position</nav><h1>Module <code>CCParse.Position</code></h1><h3 id="positions-in-input"><a href="#positions-in-input" class="anchor"></a>Positions in input</h3><dl><dt>since</dt><dd>NEXT_RELEASE</dd></dl></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <a href="../index.html#type-position">position</a></code></dt></dl><dl><dt class="spec value" id="val-line"><a href="#val-line" class="anchor"></a><code><span class="keyword">val</span> line : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>Line number</p></dd></dl><dl><dt class="spec value" id="val-column"><a href="#val-column" class="anchor"></a><code><span class="keyword">val</span> column : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>Column number</p></dd></dl><dl><dt class="spec value" id="val-line_and_column"><a href="#val-line_and_column" class="anchor"></a><code><span class="keyword">val</span> line_and_column : <a href="index.html#type-t">t</a> <span>-></span> int * int</code></dt><dd><p>Line and column number</p></dd></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p>Unspecified pretty-printed version of the position.</p></dd></dl></div></body></html>
|
||||
2
dev/containers/CCParse/Slice/index.html
Normal file
2
dev/containers/CCParse/Slice/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Slice (containers.CCParse.Slice)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.3"/><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">containers</a> » <a href="../index.html">CCParse</a> » Slice</nav><h1>Module <code>CCParse.Slice</code></h1><p>Functions on slices.</p><dl><dt>since</dt><dd>NEXT_RELEASE</dd></dl></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <a href="../index.html#type-slice">slice</a></code></dt></dl><dl><dt class="spec value" id="val-is_empty"><a href="#val-is_empty" class="anchor"></a><code><span class="keyword">val</span> is_empty : <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dd><p>Is the slice empty?</p></dd></dl><dl><dt class="spec value" id="val-length"><a href="#val-length" class="anchor"></a><code><span class="keyword">val</span> length : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>Length of the slice</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 : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p>Convert the slice into a string. Linear time and memory in <code>length slice</code></p></dd></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue