mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
2 lines
No EOL
7.5 KiB
HTML
2 lines
No EOL
7.5 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (containers-data.CCMixmap.Make)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.1"/><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-data</a> » <a href="../index.html">CCMixmap</a> » Make</nav><h1>Module <code>CCMixmap.Make</code></h1><nav class="toc"><ul><li><a href="#iterators">Iterators</a></li></ul></nav></header><h3 class="heading">Parameters</h3><ul><li><code><a href="argument-1-X/index.html">X</a> : <a href="../index.html#module-type-ORD">ORD</a></code></li></ul><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> = <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 : <span>inj:<span><span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a></span></span> <span>-></span> <a href="index.html#type-key">key</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <span><span class="type-var">'a</span> option</span></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 : <span>inj:<span><span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a></span></span> <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 : <span>inj:<span><span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a></span></span> <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 : <span>inj:<span><span class="type-var">_</span> <a href="../index.html#type-injection">injection</a></span></span> <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 : <span>f:<span>(<a href="index.html#type-key">key</a> <span>-></span> unit)</span></span> <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 : <span>f:<span>(<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> <span>-></span> <span>x:<span class="type-var">'a</span></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><h3 id="iterators"><a href="#iterators" class="anchor"></a>Iterators</h3></header><dl><dt class="spec type" id="type-iter"><a href="#type-iter" class="anchor"></a><code><span class="keyword">type</span> <span>'a iter</span></code><code> = <span>(<span class="type-var">'a</span> <span>-></span> unit)</span> <span>-></span> unit</code></dt></dl><dl><dt class="spec value" id="val-keys_iter"><a href="#val-keys_iter" class="anchor"></a><code><span class="keyword">val</span> keys_iter : <a href="index.html#type-t">t</a> <span>-></span> <span><a href="index.html#type-key">key</a> <a href="index.html#type-iter">iter</a></span></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 : <span>inj:<span><span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a></span></span> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <span><span>(<a href="index.html#type-key">key</a> * <span class="type-var">'a</span>)</span> <a href="index.html#type-iter">iter</a></span></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> = </code><table class="variant"><tr id="type-value.Value" class="anchored"><td class="def constructor"><a href="#type-value.Value" class="anchor"></a><code>| </code><code><span class="constructor">Value</span> : <span>(<span><span class="type-var">'a</span> <a href="../index.html#type-injection">injection</a></span> <span>-></span> <span><span class="type-var">'a</span> option</span>)</span> <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> <span><span>(<a href="index.html#type-key">key</a> * <a href="index.html#type-value">value</a>)</span> <a href="index.html#type-iter">iter</a></span></code></dt><dd><p>Iterate on all bindings.</p></dd></dl></section></div></body></html> |