ocaml-containers/2.6/containers/CCTrie/String/index.html
2019-06-18 23:01:25 -05:00

2 lines
No EOL
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>String (containers.CCTrie.String)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><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> &#x00BB; <a href="../index.html">CCTrie</a> &#x00BB; String</nav><h1>Module <code>CCTrie.String</code></h1><nav class="toc"><ul><li><a href="#conversions">Conversions</a></li><li><a href="#ranges">Ranges</a></li></ul></nav></header><dl><dt class="spec type" id="type-char_"><a href="#type-char_" class="anchor"></a><code><span class="keyword">type</span> char_</code><code> = char</code></dt><dt class="spec type" id="type-key"><a href="#type-key" class="anchor"></a><code><span class="keyword">type</span> key</code><code> = string</code></dt><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> 'a t</code></dt></dl><dl><dt class="spec value" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span class="keyword">val</span> empty : <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-is_empty"><a href="#val-is_empty" class="anchor"></a><code><span class="keyword">val</span> is_empty : <span class="type-var">_</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-add"><a href="#val-add" class="anchor"></a><code><span class="keyword">val</span> add : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Add a binding to the trie (possibly erasing the previous one).</p></dd></dl><dl><dt class="spec value" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span class="keyword">val</span> remove : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Remove the key, if present.</p></dd></dl><dl><dt class="spec value" id="val-find"><a href="#val-find" class="anchor"></a><code><span class="keyword">val</span> find : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> option</code></dt><dd><p>Find the value associated with the key, if any.</p></dd></dl><dl><dt class="spec value" id="val-find_exn"><a href="#val-find_exn" class="anchor"></a><code><span class="keyword">val</span> find_exn : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span></code></dt><dd><p>Same as <a href="index.html#val-find"><code>find</code></a> but can fail.</p><dl><dt>raises Not_found</dt><dd><p>if the key is not present.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-longest_prefix"><a href="#val-longest_prefix" class="anchor"></a><code><span class="keyword">val</span> longest_prefix : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-key">key</a></code></dt><dd><p><code>longest_prefix k m</code> finds the longest prefix of <code>k</code> that leads to at least one path in <code>m</code> (it does not mean that the prefix is bound to a value.</p><p>Example: if <code>m</code> has keys &quot;abc0&quot; and &quot;abcd&quot;, then <code>longest_prefix &quot;abc2&quot; m</code> will return &quot;abc&quot;.</p><dl><dt>since</dt><dd>0.17</dd></dl></dd></dl><dl><dt class="spec value" id="val-update"><a href="#val-update" class="anchor"></a><code><span class="keyword">val</span> update : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> (<span class="type-var">'a</span> option <span>&#45;&gt;</span> <span class="type-var">'a</span> option) <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Update the binding for the given key. The function is given <code>None</code> if the key is absent, or <code>Some v</code> if <code>key</code> is bound to <code>v</code>; if it returns <code>None</code> the key is removed, otherwise it returns <code>Some y</code> and <code>key</code> becomes bound to <code>y</code>.</p></dd></dl><dl><dt class="spec value" id="val-fold"><a href="#val-fold" class="anchor"></a><code><span class="keyword">val</span> fold : (<span class="type-var">'b</span> <span>&#45;&gt;</span> <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'b</span>) <span>&#45;&gt;</span> <span class="type-var">'b</span> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'b</span></code></dt><dd><p>Fold on key/value bindings. Will use <a href="../module-type-WORD/index.html#val-of_list"><code>WORD.of_list</code></a> to rebuild keys.</p></dd></dl><dl><dt class="spec value" id="val-mapi"><a href="#val-mapi" class="anchor"></a><code><span class="keyword">val</span> mapi : (<a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'b</span>) <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Map values, giving both key and value. Will use <a href="../module-type-WORD/index.html#val-of_list"><code>WORD.of_list</code></a> to rebuild keys.</p><dl><dt>since</dt><dd>0.17</dd></dl></dd></dl><dl><dt class="spec value" id="val-map"><a href="#val-map" class="anchor"></a><code><span class="keyword">val</span> map : (<span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'b</span>) <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Map values, giving only the value.</p><dl><dt>since</dt><dd>0.17</dd></dl></dd></dl><dl><dt class="spec value" id="val-iter"><a href="#val-iter" class="anchor"></a><code><span class="keyword">val</span> iter : (<a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> unit) <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>Same as <a href="index.html#val-fold"><code>fold</code></a>, but for effectful functions.</p></dd></dl><dl><dt class="spec value" id="val-fold_values"><a href="#val-fold_values" class="anchor"></a><code><span class="keyword">val</span> fold_values : (<span class="type-var">'b</span> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'b</span>) <span>&#45;&gt;</span> <span class="type-var">'b</span> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'b</span></code></dt><dd><p>More efficient version of <a href="index.html#val-fold"><code>fold</code></a>, that doesn't keep keys.</p></dd></dl><dl><dt class="spec value" id="val-iter_values"><a href="#val-iter_values" class="anchor"></a><code><span class="keyword">val</span> iter_values : (<span class="type-var">'a</span> <span>&#45;&gt;</span> unit) <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dt class="spec value" id="val-merge"><a href="#val-merge" class="anchor"></a><code><span class="keyword">val</span> merge : (<span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'a</span> option) <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dd><p>Merge two tries together. The function is used in case of conflicts, when a key belongs to both tries.</p></dd></dl><dl><dt class="spec value" id="val-size"><a href="#val-size" class="anchor"></a><code><span class="keyword">val</span> size : <span class="type-var">_</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> int</code></dt><dd><p>Number of bindings.</p></dd></dl><section><header><h5 id="conversions"><a href="#conversions" class="anchor"></a>Conversions</h5></header><dl><dt class="spec value" id="val-to_list"><a href="#val-to_list" class="anchor"></a><code><span class="keyword">val</span> to_list : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> (<a href="index.html#type-key">key</a> * <span class="type-var">'a</span>) list</code></dt><dt class="spec value" id="val-of_list"><a href="#val-of_list" class="anchor"></a><code><span class="keyword">val</span> of_list : (<a href="index.html#type-key">key</a> * <span class="type-var">'a</span>) list <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-to_seq"><a href="#val-to_seq" class="anchor"></a><code><span class="keyword">val</span> to_seq : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> (<a href="index.html#type-key">key</a> * <span class="type-var">'a</span>) <a href="../index.html#type-sequence">sequence</a></code></dt><dt class="spec value" id="val-of_seq"><a href="#val-of_seq" class="anchor"></a><code><span class="keyword">val</span> of_seq : (<a href="index.html#type-key">key</a> * <span class="type-var">'a</span>) <a href="../index.html#type-sequence">sequence</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-to_seq_values"><a href="#val-to_seq_values" class="anchor"></a><code><span class="keyword">val</span> to_seq_values : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="../index.html#type-sequence">sequence</a></code></dt><dt class="spec value" id="val-to_tree"><a href="#val-to_tree" class="anchor"></a><code><span class="keyword">val</span> to_tree : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> [ `Char of <a href="index.html#type-char_">char_</a> | `Val of <span class="type-var">'a</span> | `Switch ] <a href="../index.html#type-ktree">ktree</a></code></dt></dl></section><section><header><h5 id="ranges"><a href="#ranges" class="anchor"></a>Ranges</h5></header><dl><dt class="spec value" id="val-above"><a href="#val-above" class="anchor"></a><code><span class="keyword">val</span> above : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> (<a href="index.html#type-key">key</a> * <span class="type-var">'a</span>) <a href="../index.html#type-sequence">sequence</a></code></dt><dd><p>All bindings whose key is bigger or equal to the given key, in ascending order.</p></dd></dl><dl><dt class="spec value" id="val-below"><a href="#val-below" class="anchor"></a><code><span class="keyword">val</span> below : <a href="index.html#type-key">key</a> <span>&#45;&gt;</span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> (<a href="index.html#type-key">key</a> * <span class="type-var">'a</span>) <a href="../index.html#type-sequence">sequence</a></code></dt><dd><p>All bindings whose key is smaller or equal to the given key, in decreasing order.</p></dd></dl></section></div></body></html>