mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
145 lines
No EOL
9.4 KiB
HTML
145 lines
No EOL
9.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="Start" href="index.html">
|
|
<link rel="Up" href="CCMap.html">
|
|
<link title="Index of types" rel=Appendix href="index_types.html">
|
|
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
|
|
<link title="Index of values" rel=Appendix href="index_values.html">
|
|
<link title="Index of class methods" rel=Appendix href="index_methods.html">
|
|
<link title="Index of class types" rel=Appendix href="index_class_types.html">
|
|
<link title="Index of modules" rel=Appendix href="index_modules.html">
|
|
<link title="Index of module types" rel=Appendix href="index_module_types.html">
|
|
<link title="CCVector" rel="Chapter" href="CCVector.html">
|
|
<link title="CCHeap" rel="Chapter" href="CCHeap.html">
|
|
<link title="CCList" rel="Chapter" href="CCList.html">
|
|
<link title="CCOpt" rel="Chapter" href="CCOpt.html">
|
|
<link title="CCPair" rel="Chapter" href="CCPair.html">
|
|
<link title="CCFun" rel="Chapter" href="CCFun.html">
|
|
<link title="CCHash" rel="Chapter" href="CCHash.html">
|
|
<link title="CCInt" rel="Chapter" href="CCInt.html">
|
|
<link title="CCBool" rel="Chapter" href="CCBool.html">
|
|
<link title="CCFloat" rel="Chapter" href="CCFloat.html">
|
|
<link title="CCArray" rel="Chapter" href="CCArray.html">
|
|
<link title="CCRef" rel="Chapter" href="CCRef.html">
|
|
<link title="CCSet" rel="Chapter" href="CCSet.html">
|
|
<link title="CCOrd" rel="Chapter" href="CCOrd.html">
|
|
<link title="CCRandom" rel="Chapter" href="CCRandom.html">
|
|
<link title="CCString" rel="Chapter" href="CCString.html">
|
|
<link title="CCHashtbl" rel="Chapter" href="CCHashtbl.html">
|
|
<link title="CCMap" rel="Chapter" href="CCMap.html">
|
|
<link title="CCFormat" rel="Chapter" href="CCFormat.html">
|
|
<link title="CCIO" rel="Chapter" href="CCIO.html">
|
|
<link title="CCInt64" rel="Chapter" href="CCInt64.html">
|
|
<link title="CCChar" rel="Chapter" href="CCChar.html">
|
|
<link title="CCResult" rel="Chapter" href="CCResult.html">
|
|
<link title="CCParse" rel="Chapter" href="CCParse.html">
|
|
<link title="CCArray_slice" rel="Chapter" href="CCArray_slice.html">
|
|
<link title="CCListLabels" rel="Chapter" href="CCListLabels.html">
|
|
<link title="CCArrayLabels" rel="Chapter" href="CCArrayLabels.html">
|
|
<link title="CCEqual" rel="Chapter" href="CCEqual.html">
|
|
<link title="Containers" rel="Chapter" href="Containers.html">
|
|
<link title="CCKTree" rel="Chapter" href="CCKTree.html">
|
|
<link title="CCKList" rel="Chapter" href="CCKList.html">
|
|
<link title="CCLazy_list" rel="Chapter" href="CCLazy_list.html">
|
|
<link title="CCMultiMap" rel="Chapter" href="CCMultiMap.html">
|
|
<link title="CCMultiSet" rel="Chapter" href="CCMultiSet.html">
|
|
<link title="CCTrie" rel="Chapter" href="CCTrie.html">
|
|
<link title="CCFlatHashtbl" rel="Chapter" href="CCFlatHashtbl.html">
|
|
<link title="CCCache" rel="Chapter" href="CCCache.html">
|
|
<link title="CCPersistentHashtbl" rel="Chapter" href="CCPersistentHashtbl.html">
|
|
<link title="CCDeque" rel="Chapter" href="CCDeque.html">
|
|
<link title="CCFQueue" rel="Chapter" href="CCFQueue.html">
|
|
<link title="CCBV" rel="Chapter" href="CCBV.html">
|
|
<link title="CCMixtbl" rel="Chapter" href="CCMixtbl.html">
|
|
<link title="CCMixmap" rel="Chapter" href="CCMixmap.html">
|
|
<link title="CCRingBuffer" rel="Chapter" href="CCRingBuffer.html">
|
|
<link title="CCIntMap" rel="Chapter" href="CCIntMap.html">
|
|
<link title="CCPersistentArray" rel="Chapter" href="CCPersistentArray.html">
|
|
<link title="CCMixset" rel="Chapter" href="CCMixset.html">
|
|
<link title="CCGraph" rel="Chapter" href="CCGraph.html">
|
|
<link title="CCHashSet" rel="Chapter" href="CCHashSet.html">
|
|
<link title="CCBitField" rel="Chapter" href="CCBitField.html">
|
|
<link title="CCHashTrie" rel="Chapter" href="CCHashTrie.html">
|
|
<link title="CCWBTree" rel="Chapter" href="CCWBTree.html">
|
|
<link title="CCRAL" rel="Chapter" href="CCRAL.html">
|
|
<link title="CCSimple_queue" rel="Chapter" href="CCSimple_queue.html">
|
|
<link title="CCImmutArray" rel="Chapter" href="CCImmutArray.html">
|
|
<link title="CCHet" rel="Chapter" href="CCHet.html">
|
|
<link title="CCZipper" rel="Chapter" href="CCZipper.html">
|
|
<link title="CCPool" rel="Chapter" href="CCPool.html">
|
|
<link title="CCLock" rel="Chapter" href="CCLock.html">
|
|
<link title="CCSemaphore" rel="Chapter" href="CCSemaphore.html">
|
|
<link title="CCThread" rel="Chapter" href="CCThread.html">
|
|
<link title="CCBlockingQueue" rel="Chapter" href="CCBlockingQueue.html">
|
|
<link title="CCTimer" rel="Chapter" href="CCTimer.html">
|
|
<link title="CCUnix" rel="Chapter" href="CCUnix.html">
|
|
<link title="CCSexp" rel="Chapter" href="CCSexp.html">
|
|
<link title="CCSexp_lex" rel="Chapter" href="CCSexp_lex.html"><title>Containers doc : CCMap.S</title>
|
|
</head>
|
|
<body>
|
|
<div class="navbar"> <a class="up" href="CCMap.html" title="CCMap">Up</a>
|
|
</div>
|
|
<h1>Module type <a href="type_CCMap.S.html">CCMap.S</a></h1>
|
|
|
|
<pre><span class="keyword">module type</span> S = <code class="code"><span class="keyword">sig</span></code> <a href="CCMap.S.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><hr width="100%">
|
|
|
|
<pre><span class="keyword">include</span> Map.S</pre>
|
|
|
|
<pre><span id="VALget"><span class="keyword">val</span> get</span> : <code class="type">key -> 'a t -> 'a option</code></pre><div class="info ">
|
|
Safe version of <code class="code">find</code><br>
|
|
</div>
|
|
|
|
<pre><span id="VALget_or"><span class="keyword">val</span> get_or</span> : <code class="type">key -> 'a t -> default:'a -> 'a</code></pre><div class="info ">
|
|
<code class="code">get_or k m ~default</code> returns the value associated to <code class="code">k</code> if present,
|
|
and returns <code class="code">default</code> otherwise (if <code class="code">k</code> doesn't belong in <code class="code">m</code>)<br>
|
|
<b>Since</b> 0.16<br>
|
|
</div>
|
|
|
|
<pre><span id="VALupdate"><span class="keyword">val</span> update</span> : <code class="type">key -> ('a option -> 'a option) -> 'a t -> 'a t</code></pre><div class="info ">
|
|
<code class="code">update k f m</code> calls <code class="code">f (<span class="constructor">Some</span> v)</code> if <code class="code">find k m = v</code>,
|
|
otherwise it calls <code class="code">f <span class="constructor">None</span></code>. In any case, if the result is <code class="code"><span class="constructor">None</span></code>
|
|
<code class="code">k</code> is removed from <code class="code">m</code>, and if the result is <code class="code"><span class="constructor">Some</span> v'</code> then
|
|
<code class="code">add k v' m</code> is returned.<br>
|
|
</div>
|
|
|
|
<pre><span id="VALmerge_safe"><span class="keyword">val</span> merge_safe</span> : <code class="type">f:(key -> [ `Both of 'a * 'b | `Left of 'a | `Right of 'b ] -> 'c option) -><br> 'a t -> 'b t -> 'c t</code></pre><div class="info ">
|
|
<code class="code">merge_safe ~f a b</code> merges the maps <code class="code">a</code> and <code class="code">b</code> together.<br>
|
|
<b>Since</b> 0.17<br>
|
|
</div>
|
|
|
|
<pre><span id="VALof_seq"><span class="keyword">val</span> of_seq</span> : <code class="type">(key * 'a) <a href="CCMap.html#TYPEsequence">CCMap.sequence</a> -> 'a t</code></pre><div class="info ">
|
|
Same as <a href="CCMap.S.html#VALof_list"><code class="code"><span class="constructor">CCMap</span>.<span class="constructor">S</span>.of_list</code></a><br>
|
|
</div>
|
|
|
|
<pre><span id="VALadd_seq"><span class="keyword">val</span> add_seq</span> : <code class="type">'a t -> (key * 'a) <a href="CCMap.html#TYPEsequence">CCMap.sequence</a> -> 'a t</code></pre><div class="info ">
|
|
<b>Since</b> 0.14<br>
|
|
</div>
|
|
|
|
<pre><span id="VALto_seq"><span class="keyword">val</span> to_seq</span> : <code class="type">'a t -> (key * 'a) <a href="CCMap.html#TYPEsequence">CCMap.sequence</a></code></pre>
|
|
<pre><span id="VALof_list"><span class="keyword">val</span> of_list</span> : <code class="type">(key * 'a) list -> 'a t</code></pre><div class="info ">
|
|
Build a map from the given list of bindings <code class="code">k_i <span class="keywordsign">-></span> v_i</code>,
|
|
added in order using <code class="code">add</code>.
|
|
If a key occurs several times, only its last binding
|
|
will be present in the result.<br>
|
|
</div>
|
|
|
|
<pre><span id="VALadd_list"><span class="keyword">val</span> add_list</span> : <code class="type">'a t -> (key * 'a) list -> 'a t</code></pre><div class="info ">
|
|
<b>Since</b> 0.14<br>
|
|
</div>
|
|
|
|
<pre><span id="VALkeys"><span class="keyword">val</span> keys</span> : <code class="type">'a t -> key <a href="CCMap.html#TYPEsequence">CCMap.sequence</a></code></pre><div class="info ">
|
|
Iterate on keys only<br>
|
|
<b>Since</b> 0.15<br>
|
|
</div>
|
|
|
|
<pre><span id="VALvalues"><span class="keyword">val</span> values</span> : <code class="type">'a t -> 'a <a href="CCMap.html#TYPEsequence">CCMap.sequence</a></code></pre><div class="info ">
|
|
Iterate on values only<br>
|
|
<b>Since</b> 0.15<br>
|
|
</div>
|
|
|
|
<pre><span id="VALto_list"><span class="keyword">val</span> to_list</span> : <code class="type">'a t -> (key * 'a) list</code></pre>
|
|
<pre><span id="VALpp"><span class="keyword">val</span> pp</span> : <code class="type">?start:string -><br> ?stop:string -><br> ?arrow:string -><br> ?sep:string -> key <a href="CCMap.html#TYPEprinter">CCMap.printer</a> -> 'a <a href="CCMap.html#TYPEprinter">CCMap.printer</a> -> 'a t <a href="CCMap.html#TYPEprinter">CCMap.printer</a></code></pre></body></html> |