mirror of
https://github.com/c-cube/nanoev.git
synced 2025-12-09 20:55:46 -05:00
2 lines
3.1 KiB
HTML
2 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>DLS (picos.Picos_domain.DLS)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.0.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../index.html">Index</a> » <a href="../../index.html">picos</a> » <a href="../index.html">Picos_domain</a> » DLS</nav><header class="odoc-preamble"><h1>Module <code><span>Picos_domain.DLS</span></code></h1><p>Domain-local storage for Picos.</p><p>ℹ️ On OCaml 4 there is always only a single domain.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-key"><a href="#type-key" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a key</span></span></code></div><div class="spec-doc"><p>Represents a key for storing values of type <code>'a</code> in storage associated with domains.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-new_key"><a href="#val-new_key" class="anchor"></a><code><span><span class="keyword">val</span> new_key : <span><span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <a href="#type-key">key</a></span></span></code></div><div class="spec-doc"><p><code>new_key compute</code> allocates a new key for associating values in storage associated with domains. The initial value for each domain is <code>compute</code>d by calling the given function if the <code>key</code> is <a href="#val-get" title="get">read</a> before it has been <a href="#val-set" title="set">written</a>. The <code>compute</code> function might be called multiple times per domain, but only one result will be used.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><span><span class="type-var">'a</span> <a href="#type-key">key</a></span> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>get key</code> returns the value associated with the <code>key</code> in the storage associated with the current domain.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span><span><span class="type-var">'a</span> <a href="#type-key">key</a></span> <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>set key value</code> sets the <code>value</code> associated with the <code>key</code> in the storage associated with the current domain.</p></div></div></div></body></html>
|