mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-05 19:00:31 -05:00
2 lines
No EOL
3.4 KiB
HTML
2 lines
No EOL
3.4 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Transient (containers-data.CCHashTrie.Transient)</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">CCHashTrie</a> » Transient</nav><h1>Module <code>CCHashTrie.Transient</code></h1><h3 id="transient-identifiers"><a href="#transient-identifiers" class="anchor"></a>Transient Identifiers</h3></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>Identifiers for transient modifications. A transient modification is uniquely identified by a <code>Transient.t</code>. Once <code>Transient.freeze r</code> is called, <code>r</code> cannot be used to modify the structure again.</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val</span> create : unit <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p>Create a new, active ID.</p></dd></dl><dl><dt class="spec value" id="val-equal"><a href="#val-equal" class="anchor"></a><code><span class="keyword">val</span> equal : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dd><p>Equality between IDs.</p></dd></dl><dl><dt class="spec value" id="val-frozen"><a href="#val-frozen" class="anchor"></a><code><span class="keyword">val</span> frozen : <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dd><p><code>frozen i</code> returns <code>true</code> if <code>freeze i</code> was called before. In this case, the ID cannot be used for modifications again.</p></dd></dl><dl><dt class="spec value" id="val-active"><a href="#val-active" class="anchor"></a><code><span class="keyword">val</span> active : <a href="index.html#type-t">t</a> <span>-></span> bool</code></dt><dd><p><code>active i</code> is <code>not (frozen i)</code>.</p></dd></dl><dl><dt class="spec value" id="val-freeze"><a href="#val-freeze" class="anchor"></a><code><span class="keyword">val</span> freeze : <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dd><p><code>freeze i</code> makes <code>i</code> unusable for new modifications. The values created with <code>i</code> will now be immutable.</p></dd></dl><dl><dt class="spec value" id="val-with_"><a href="#val-with_" class="anchor"></a><code><span class="keyword">val</span> with_ : <span>(<a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'a</span>)</span> <span>-></span> <span class="type-var">'a</span></code></dt><dd><p><code>with_ f</code> creates a transient ID <code>i</code>, calls <code>f i</code>, freezes the ID <code>i</code> and returns the result of <code>f i</code>.</p></dd></dl><dl><dt class="spec exception" id="exception-Frozen"><a href="#exception-Frozen" class="anchor"></a><code><span class="keyword">exception</span> </code><code><span class="exception">Frozen</span></code></dt><dd><p>Raised when a frozen ID is used.</p></dd></dl></div></body></html> |