mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 11:45:31 -05:00
2 lines
No EOL
7.3 KiB
HTML
2 lines
No EOL
7.3 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (containers.CCMixmap.Make)</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> » <a href="../index.html">CCMixmap</a> » Make</nav><h1>Module <code>CCMixmap.Make</code></h1></header><h3 class="heading">Parameters</h3><dl><code><a href="argument-1-X/index.html">X</a> : <a href="../index.html#module-type-ORD">ORD</a></code></dl><h3 class="heading">Signature</h3><dl><dt class="spec type" id="type-key"><a href="#type-key" class="anchor"></a><code><span class="keyword">type </span>key</code><code><span class="keyword"> = </span><a href="argument-1-X/index.html#type-t">X.t</a></code></dt><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 map containing values of different types, indexed by <a href="index.html#type-key"><code>key</code></a>.</p></dd></dl><dl><dt class="spec value" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span class="keyword">val </span>empty : <a href="index.html#type-t">t</a></code></dt><dd><p>Empty map.</p></dd></dl><dl><dt class="spec value" id="val-get"><a href="#val-get" class="anchor"></a><code><span class="keyword">val </span>get : inj:<span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a> <span>-></span> <a href="index.html#type-key">key</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span> option</code></dt><dd><p>Get the value corresponding to this key, if it exists and belongs to the same key.</p></dd></dl><dl><dt class="spec value" id="val-add"><a href="#val-add" class="anchor"></a><code><span class="keyword">val </span>add : inj:<span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a> <span>-></span> <a href="index.html#type-key">key</a> <span>-></span> <span class="type-var">'a</span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Bind the key to the value, using <code>inj</code>.</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 : inj:<span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a> <span>-></span> <a href="index.html#type-key">key</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span></code></dt><dd><p>Find the value for the given key, which must be of the right type.</p><dl><dt>raises Not_found</dt><dd><p>if either the key is not found, or if its value doesn't belong to the right type.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-cardinal"><a href="#val-cardinal" class="anchor"></a><code><span class="keyword">val </span>cardinal : <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p>Number of bindings.</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>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Remove the binding for this key.</p></dd></dl><dl><dt class="spec value" id="val-mem"><a href="#val-mem" class="anchor"></a><code><span class="keyword">val </span>mem : inj:<span class="type-var">_</span> <a href="../index.html#type-injection">injection</a> <span>-></span> <a href="index.html#type-key">key</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dd><p>Is the given key in the map, with the right type?</p></dd></dl><dl><dt class="spec value" id="val-iter_keys"><a href="#val-iter_keys" class="anchor"></a><code><span class="keyword">val </span>iter_keys : f:(<a href="index.html#type-key">key</a> <span>-></span> unit) <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p>Iterate on the keys of this map.</p></dd></dl><dl><dt class="spec value" id="val-fold_keys"><a href="#val-fold_keys" class="anchor"></a><code><span class="keyword">val </span>fold_keys : f:(<span class="type-var">'a</span> <span>-></span> <a href="index.html#type-key">key</a> <span>-></span> <span class="type-var">'a</span>) <span>-></span> x:<span class="type-var">'a</span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span></code></dt><dd><p>Fold over the keys.</p></dd></dl><section><header><h2 id="iterators"><a href="#iterators" class="anchor"></a>Iterators</h2></header><dl><dt class="spec type" id="type-sequence"><a href="#type-sequence" class="anchor"></a><code><span class="keyword">type </span>'a sequence</code><code><span class="keyword"> = </span>(<span class="type-var">'a</span> <span>-></span> unit) <span>-></span> unit</code></dt></dl><dl><dt class="spec value" id="val-keys_seq"><a href="#val-keys_seq" class="anchor"></a><code><span class="keyword">val </span>keys_seq : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-key">key</a> <a href="index.html#type-sequence">sequence</a></code></dt><dd><p>All the keys.</p></dd></dl><dl><dt class="spec value" id="val-bindings_of"><a href="#val-bindings_of" class="anchor"></a><code><span class="keyword">val </span>bindings_of : inj:<span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> (<a href="index.html#type-key">key</a><span class="keyword"> * </span><span class="type-var">'a</span>) <a href="index.html#type-sequence">sequence</a></code></dt><dd><p>All the bindings that come from the corresponding injection.</p></dd></dl><dl><dt class="spec type" id="type-value"><a href="#type-value" class="anchor"></a><code><span class="keyword">type </span>value</code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-value.Value" class="anchored"><td class="def constructor"><a href="#type-value.Value" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Value</span><span class="keyword"> : </span>(<span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a> <span>-></span> <span class="type-var">'a</span> option) <span>-></span> <a href="index.html#type-value">value</a></code></td></tr></table></dt></dl><dl><dt class="spec value" id="val-bindings"><a href="#val-bindings" class="anchor"></a><code><span class="keyword">val </span>bindings : <a href="index.html#type-t">t</a> <span>-></span> (<a href="index.html#type-key">key</a><span class="keyword"> * </span><a href="index.html#type-value">value</a>) <a href="index.html#type-sequence">sequence</a></code></dt><dd><p>Iterate on all bindings.</p></dd></dl></section></div></body></html> |