mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
201 lines
No EOL
13 KiB
HTML
201 lines
No EOL
13 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">
|
|
<link rel="Start" href="index.html">
|
|
<link rel="previous" href="CCFloat.html">
|
|
<link rel="next" href="CCRef.html">
|
|
<link rel="Up" href="index.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="CCPrint" rel="Chapter" href="CCPrint.html">
|
|
<link title="CCError" rel="Chapter" href="CCError.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="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="CCHashconsedSet" rel="Chapter" href="CCHashconsedSet.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="CCBloom" rel="Chapter" href="CCBloom.html">
|
|
<link title="CCWBTree" rel="Chapter" href="CCWBTree.html">
|
|
<link title="CCRAL" rel="Chapter" href="CCRAL.html">
|
|
<link title="CCAllocCache" rel="Chapter" href="CCAllocCache.html">
|
|
<link title="CCImmutArray" rel="Chapter" href="CCImmutArray.html">
|
|
<link title="CCHet" rel="Chapter" href="CCHet.html">
|
|
<link title="Containers_string" rel="Chapter" href="Containers_string.html">
|
|
<link title="CCKMP" rel="Chapter" href="CCKMP.html">
|
|
<link title="CCLevenshtein" rel="Chapter" href="CCLevenshtein.html">
|
|
<link title="CCApp_parse" rel="Chapter" href="CCApp_parse.html">
|
|
<link title="CCParse" rel="Chapter" href="CCParse.html">
|
|
<link title="CCBigstring" rel="Chapter" href="CCBigstring.html">
|
|
<link title="CCArray1" rel="Chapter" href="CCArray1.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="Containers_advanced" rel="Chapter" href="Containers_advanced.html">
|
|
<link title="CCLinq" rel="Chapter" href="CCLinq.html">
|
|
<link title="CCBatch" rel="Chapter" href="CCBatch.html">
|
|
<link title="CCCat" rel="Chapter" href="CCCat.html">
|
|
<link title="CCMonadIO" rel="Chapter" href="CCMonadIO.html">
|
|
<link title="Containers_io_is_deprecated" rel="Chapter" href="Containers_io_is_deprecated.html">
|
|
<link title="CCUnix" rel="Chapter" href="CCUnix.html">
|
|
<link title="CCSexp" rel="Chapter" href="CCSexp.html">
|
|
<link title="CCSexpM" rel="Chapter" href="CCSexpM.html"><link title="Abstract Signature" rel="Section" href="#2_AbstractSignature">
|
|
<link title="Arrays" rel="Section" href="#2_Arrays">
|
|
<link title="Slices" rel="Section" href="#2_Slices">
|
|
<link title="Generic Functions" rel="Section" href="#2_GenericFunctions">
|
|
<title>Containers doc : CCArray</title>
|
|
</head>
|
|
<body>
|
|
<div class="navbar"><a class="pre" href="CCFloat.html" title="CCFloat">Previous</a>
|
|
<a class="up" href="index.html" title="Index">Up</a>
|
|
<a class="post" href="CCRef.html" title="CCRef">Next</a>
|
|
</div>
|
|
<h1>Module <a href="type_CCArray.html">CCArray</a></h1>
|
|
|
|
<pre><span class="keyword">module</span> CCArray: <code class="code"><span class="keyword">sig</span></code> <a href="CCArray.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info module top">
|
|
<h1 id="1_Arrayutils">Array utils</h1><br>
|
|
</div>
|
|
<hr width="100%">
|
|
|
|
<pre><span id="TYPEsequence"><span class="keyword">type</span> <code class="type">'a</code> sequence</span> = <code class="type">('a -> unit) -> unit</code> </pre>
|
|
|
|
|
|
<pre><span id="TYPEklist"><span class="keyword">type</span> <code class="type">'a</code> klist</span> = <code class="type">unit -> [ `Cons of 'a * 'a <a href="CCArray.html#TYPEklist">klist</a> | `Nil ]</code> </pre>
|
|
|
|
|
|
<pre><span id="TYPEgen"><span class="keyword">type</span> <code class="type">'a</code> gen</span> = <code class="type">unit -> 'a option</code> </pre>
|
|
|
|
|
|
<pre><span id="TYPEequal"><span class="keyword">type</span> <code class="type">'a</code> equal</span> = <code class="type">'a -> 'a -> bool</code> </pre>
|
|
|
|
|
|
<pre><span id="TYPEord"><span class="keyword">type</span> <code class="type">'a</code> ord</span> = <code class="type">'a -> 'a -> int</code> </pre>
|
|
|
|
|
|
<pre><span id="TYPErandom_gen"><span class="keyword">type</span> <code class="type">'a</code> random_gen</span> = <code class="type">Random.State.t -> 'a</code> </pre>
|
|
|
|
<br>
|
|
<h2 id="2_AbstractSignature">Abstract Signature</h2><br>
|
|
|
|
<pre><span class="keyword">module type</span> <a href="CCArray.S.html">S</a> = <code class="code"><span class="keyword">sig</span></code> <a href="CCArray.S.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
|
|
<h2 id="2_Arrays">Arrays</h2><br>
|
|
|
|
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type">'a</code> t</span> = <code class="type">'a array</code> </pre>
|
|
|
|
|
|
<pre><span class="keyword">include</span> <a href="CCArray.S.html">CCArray.S</a></pre>
|
|
|
|
<pre><span id="VALmap"><span class="keyword">val</span> map</span> : <code class="type">('a -> 'b) -> 'a <a href="CCArray.html#TYPEt">t</a> -> 'b <a href="CCArray.html#TYPEt">t</a></code></pre>
|
|
<pre><span id="VALfilter"><span class="keyword">val</span> filter</span> : <code class="type">('a -> bool) -> 'a <a href="CCArray.html#TYPEt">t</a> -> 'a <a href="CCArray.html#TYPEt">t</a></code></pre><div class="info ">
|
|
Filter elements out of the array. Only the elements satisfying
|
|
the given predicate will be kept.<br>
|
|
</div>
|
|
|
|
<pre><span id="VALfilter_map"><span class="keyword">val</span> filter_map</span> : <code class="type">('a -> 'b option) -> 'a <a href="CCArray.html#TYPEt">t</a> -> 'b <a href="CCArray.html#TYPEt">t</a></code></pre><div class="info ">
|
|
Map each element into another value, or discard it<br>
|
|
</div>
|
|
|
|
<pre><span id="VALflat_map"><span class="keyword">val</span> flat_map</span> : <code class="type">('a -> 'b <a href="CCArray.html#TYPEt">t</a>) -> 'a <a href="CCArray.html#TYPEt">t</a> -> 'b array</code></pre><div class="info ">
|
|
Transform each element into an array, then flatten<br>
|
|
</div>
|
|
|
|
<pre><span id="VAL(>>=)"><span class="keyword">val</span> (>>=)</span> : <code class="type">'a <a href="CCArray.html#TYPEt">t</a> -> ('a -> 'b <a href="CCArray.html#TYPEt">t</a>) -> 'b <a href="CCArray.html#TYPEt">t</a></code></pre><div class="info ">
|
|
Infix version of <a href="CCArray.html#VALflat_map"><code class="code"><span class="constructor">CCArray</span>.flat_map</code></a><br>
|
|
</div>
|
|
|
|
<pre><span id="VAL(>>|)"><span class="keyword">val</span> (>>|)</span> : <code class="type">'a <a href="CCArray.html#TYPEt">t</a> -> ('a -> 'b) -> 'b <a href="CCArray.html#TYPEt">t</a></code></pre><div class="info ">
|
|
Infix version of <a href="CCArray.html#VALmap"><code class="code"><span class="constructor">CCArray</span>.map</code></a><br>
|
|
<b>Since</b> 0.8<br>
|
|
</div>
|
|
|
|
<pre><span id="VAL(>|=)"><span class="keyword">val</span> (>|=)</span> : <code class="type">'a <a href="CCArray.html#TYPEt">t</a> -> ('a -> 'b) -> 'b <a href="CCArray.html#TYPEt">t</a></code></pre><div class="info ">
|
|
Infix version of <a href="CCArray.html#VALmap"><code class="code"><span class="constructor">CCArray</span>.map</code></a><br>
|
|
<b>Since</b> 0.8<br>
|
|
</div>
|
|
|
|
<pre><span id="VALexcept_idx"><span class="keyword">val</span> except_idx</span> : <code class="type">'a <a href="CCArray.html#TYPEt">t</a> -> int -> 'a list</code></pre><div class="info ">
|
|
Remove given index, obtaining the list of the other elements<br>
|
|
</div>
|
|
|
|
<pre><span id="VAL(--)"><span class="keyword">val</span> (--)</span> : <code class="type">int -> int -> int <a href="CCArray.html#TYPEt">t</a></code></pre><div class="info ">
|
|
Range array<br>
|
|
</div>
|
|
|
|
<pre><span id="VAL(--^)"><span class="keyword">val</span> (--^)</span> : <code class="type">int -> int -> int <a href="CCArray.html#TYPEt">t</a></code></pre><div class="info ">
|
|
Range array, excluding right bound<br>
|
|
<b>Since</b> 0.17<br>
|
|
</div>
|
|
|
|
<pre><span id="VALrandom"><span class="keyword">val</span> random</span> : <code class="type">'a <a href="CCArray.html#TYPErandom_gen">random_gen</a> -> 'a <a href="CCArray.html#TYPEt">t</a> <a href="CCArray.html#TYPErandom_gen">random_gen</a></code></pre>
|
|
<pre><span id="VALrandom_non_empty"><span class="keyword">val</span> random_non_empty</span> : <code class="type">'a <a href="CCArray.html#TYPErandom_gen">random_gen</a> -> 'a <a href="CCArray.html#TYPEt">t</a> <a href="CCArray.html#TYPErandom_gen">random_gen</a></code></pre>
|
|
<pre><span id="VALrandom_len"><span class="keyword">val</span> random_len</span> : <code class="type">int -> 'a <a href="CCArray.html#TYPErandom_gen">random_gen</a> -> 'a <a href="CCArray.html#TYPEt">t</a> <a href="CCArray.html#TYPErandom_gen">random_gen</a></code></pre><br>
|
|
<h2 id="2_Slices">Slices</h2>
|
|
A slice is a part of an array, that requires no copying and shares
|
|
its storage with the original array.
|
|
<p>
|
|
|
|
All indexing in a slice is relative to the beginning of a slice, not
|
|
to the underlying array (meaning a slice is effectively like
|
|
a regular array)<br>
|
|
|
|
<pre><span class="keyword">module</span> <a href="CCArray.Sub.html">Sub</a>: <code class="code"><span class="keyword">sig</span></code> <a href="CCArray.Sub.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><br>
|
|
<h2 id="2_GenericFunctions">Generic Functions</h2><br>
|
|
|
|
<pre><span class="keyword">module type</span> <a href="CCArray.MONO_ARRAY.html">MONO_ARRAY</a> = <code class="code"><span class="keyword">sig</span></code> <a href="CCArray.MONO_ARRAY.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>
|
|
<pre><span id="VALsort_generic"><span class="keyword">val</span> sort_generic</span> : <code class="type">(module CCArray.MONO_ARRAY with type elt = 'elt and type t = 'arr) -><br> ?cmp:('elt -> 'elt -> int) -> 'arr -> unit</code></pre><div class="info ">
|
|
Sort the array, without allocating (eats stack space though). Performance
|
|
might be lower than <code class="code"><span class="constructor">Array</span>.sort</code>.<br>
|
|
<b>Since</b> 0.14<br>
|
|
</div>
|
|
</body></html> |