Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > e4471f7f8e13c237def7fefb7af912ed > files > 44

ocaml-doc-3.10.2-4mdv2009.0.i586.rpm

<!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=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="List.html">
<link rel="next" href="Map.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 modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Arg" rel="Chapter" href="Arg.html">
<link title="Arith_status" rel="Chapter" href="Arith_status.html">
<link title="Array" rel="Chapter" href="Array.html">
<link title="ArrayLabels" rel="Chapter" href="ArrayLabels.html">
<link title="Big_int" rel="Chapter" href="Big_int.html">
<link title="Bigarray" rel="Chapter" href="Bigarray.html">
<link title="Buffer" rel="Chapter" href="Buffer.html">
<link title="Callback" rel="Chapter" href="Callback.html">
<link title="CamlinternalMod" rel="Chapter" href="CamlinternalMod.html">
<link title="CamlinternalOO" rel="Chapter" href="CamlinternalOO.html">
<link title="Char" rel="Chapter" href="Char.html">
<link title="Complex" rel="Chapter" href="Complex.html">
<link title="Condition" rel="Chapter" href="Condition.html">
<link title="Dbm" rel="Chapter" href="Dbm.html">
<link title="Digest" rel="Chapter" href="Digest.html">
<link title="Dynlink" rel="Chapter" href="Dynlink.html">
<link title="Event" rel="Chapter" href="Event.html">
<link title="Filename" rel="Chapter" href="Filename.html">
<link title="Format" rel="Chapter" href="Format.html">
<link title="Gc" rel="Chapter" href="Gc.html">
<link title="Genlex" rel="Chapter" href="Genlex.html">
<link title="Graphics" rel="Chapter" href="Graphics.html">
<link title="GraphicsX11" rel="Chapter" href="GraphicsX11.html">
<link title="Hashtbl" rel="Chapter" href="Hashtbl.html">
<link title="Int32" rel="Chapter" href="Int32.html">
<link title="Int64" rel="Chapter" href="Int64.html">
<link title="Lazy" rel="Chapter" href="Lazy.html">
<link title="Lexing" rel="Chapter" href="Lexing.html">
<link title="List" rel="Chapter" href="List.html">
<link title="ListLabels" rel="Chapter" href="ListLabels.html">
<link title="Map" rel="Chapter" href="Map.html">
<link title="Marshal" rel="Chapter" href="Marshal.html">
<link title="MoreLabels" rel="Chapter" href="MoreLabels.html">
<link title="Mutex" rel="Chapter" href="Mutex.html">
<link title="Nativeint" rel="Chapter" href="Nativeint.html">
<link title="Num" rel="Chapter" href="Num.html">
<link title="Obj" rel="Chapter" href="Obj.html">
<link title="Oo" rel="Chapter" href="Oo.html">
<link title="Parsing" rel="Chapter" href="Parsing.html">
<link title="Pervasives" rel="Chapter" href="Pervasives.html">
<link title="Printexc" rel="Chapter" href="Printexc.html">
<link title="Printf" rel="Chapter" href="Printf.html">
<link title="Queue" rel="Chapter" href="Queue.html">
<link title="Random" rel="Chapter" href="Random.html">
<link title="Scanf" rel="Chapter" href="Scanf.html">
<link title="Set" rel="Chapter" href="Set.html">
<link title="Sort" rel="Chapter" href="Sort.html">
<link title="Stack" rel="Chapter" href="Stack.html">
<link title="StdLabels" rel="Chapter" href="StdLabels.html">
<link title="Str" rel="Chapter" href="Str.html">
<link title="Stream" rel="Chapter" href="Stream.html">
<link title="String" rel="Chapter" href="String.html">
<link title="StringLabels" rel="Chapter" href="StringLabels.html">
<link title="Sys" rel="Chapter" href="Sys.html">
<link title="Thread" rel="Chapter" href="Thread.html">
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
<link title="Tk" rel="Chapter" href="Tk.html">
<link title="Unix" rel="Chapter" href="Unix.html">
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
<link title="Weak" rel="Chapter" href="Weak.html"><link title="Iterators" rel="Section" href="#6_Iterators">
<link title="Iterators on two lists" rel="Section" href="#6_Iteratorsontwolists">
<link title="List scanning" rel="Section" href="#6_Listscanning">
<link title="List searching" rel="Section" href="#6_Listsearching">
<link title="Association lists" rel="Section" href="#6_Associationlists">
<link title="Lists of pairs" rel="Section" href="#6_Listsofpairs">
<link title="Sorting" rel="Section" href="#6_Sorting">
<title>ListLabels</title>
</head>
<body>
<div class="navbar"><a href="List.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Map.html">Next</a>
</div>
<center><h1>Module <a href="type_ListLabels.html">ListLabels</a></h1></center>
<br>
<pre><span class="keyword">module</span> ListLabels: <code class="code"><span class="keyword">sig</span></code> <a href="ListLabels.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>List operations.
<p>

   Some functions are flagged as not tail-recursive.  A tail-recursive
   function uses constant stack space, while a non-tail-recursive function
   uses stack space proportional to the length of its list argument, which
   can be a problem with very long lists.  When the function takes several
   list arguments, an approximate formula giving stack usage (in some
   unspecified constant unit) is shown in parentheses.
<p>

   The above considerations can usually be ignored if your lists are not
   longer than about 10000 elements.<br>
<hr width="100%">
<pre><span class="keyword">val</span> <a name="VALlength"></a>length : <code class="type">'a list -> int</code></pre><div class="info">
Return the length (number of elements) of the given list.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALhd"></a>hd : <code class="type">'a list -> 'a</code></pre><div class="info">
Return the first element of the given list. Raise
   <code class="code"><span class="constructor">Failure</span> <span class="string">"hd"</span></code> if the list is empty.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALtl"></a>tl : <code class="type">'a list -> 'a list</code></pre><div class="info">
Return the given list without its first element. Raise
   <code class="code"><span class="constructor">Failure</span> <span class="string">"tl"</span></code> if the list is empty.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALnth"></a>nth : <code class="type">'a list -> int -> 'a</code></pre><div class="info">
Return the <code class="code">n</code>-th element of the given list.
   The first element (head of the list) is at position 0.
   Raise <code class="code"><span class="constructor">Failure</span> <span class="string">"nth"</span></code> if the list is too short.
   Raise <code class="code"><span class="constructor">Invalid_argument</span> <span class="string">"List.nth"</span></code> if <code class="code">n</code> is negative.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrev"></a>rev : <code class="type">'a list -> 'a list</code></pre><div class="info">
List reversal.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALappend"></a>append : <code class="type">'a list -> 'a list -> 'a list</code></pre><div class="info">
Catenate two lists.  Same function as the infix operator <code class="code">@</code>.
   Not tail-recursive (length of the first argument).  The <code class="code">@</code>
   operator is not tail-recursive either.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrev_append"></a>rev_append : <code class="type">'a list -> 'a list -> 'a list</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.rev_append l1 l2</code> reverses <code class="code">l1</code> and concatenates it to <code class="code">l2</code>.
   This is equivalent to <a href="ListLabels.html#VALrev"><code class="code"><span class="constructor">ListLabels</span>.rev</code></a><code class="code"> l1 @ l2</code>, but <code class="code">rev_append</code> is
   tail-recursive and more efficient.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALconcat"></a>concat : <code class="type">'a list list -> 'a list</code></pre><div class="info">
Concatenate a list of lists.  The elements of the argument are all
   concatenated together (in the same order) to give the result.
   Not tail-recursive
   (length of the argument + length of the longest sub-list).<br>
</div>
<pre><span class="keyword">val</span> <a name="VALflatten"></a>flatten : <code class="type">'a list list -> 'a list</code></pre><div class="info">
Same as <code class="code">concat</code>.  Not tail-recursive
   (length of the argument + length of the longest sub-list).<br>
</div>
<br>
<a name="6_Iterators"></a>
<h6>Iterators</h6><br>
<pre><span class="keyword">val</span> <a name="VALiter"></a>iter : <code class="type">f:('a -> unit) -> 'a list -> unit</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.iter f [a1; ...; an]</code> applies function <code class="code">f</code> in turn to
   <code class="code">a1; ...; an</code>. It is equivalent to
   <code class="code"><span class="keyword">begin</span> f a1; f a2; ...; f an; () <span class="keyword">end</span></code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmap"></a>map : <code class="type">f:('a -> 'b) -> 'a list -> 'b list</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.map f [a1; ...; an]</code> applies function <code class="code">f</code> to <code class="code">a1, ..., an</code>,
   and builds the list <code class="code">[f a1; ...; f an]</code>
   with the results returned by <code class="code">f</code>.  Not tail-recursive.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrev_map"></a>rev_map : <code class="type">f:('a -> 'b) -> 'a list -> 'b list</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.rev_map f l</code> gives the same result as
   <a href="ListLabels.html#VALrev"><code class="code"><span class="constructor">ListLabels</span>.rev</code></a><code class="code"> (</code><a href="ListLabels.html#VALmap"><code class="code"><span class="constructor">ListLabels</span>.map</code></a><code class="code"> f l)</code>, but is tail-recursive and
   more efficient.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfold_left"></a>fold_left : <code class="type">f:('a -> 'b -> 'a) -> init:'a -> 'b list -> 'a</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.fold_left f a [b1; ...; bn]</code> is
   <code class="code">f (... (f (f a b1) b2) ...) bn</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfold_right"></a>fold_right : <code class="type">f:('a -> 'b -> 'b) -> 'a list -> init:'b -> 'b</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.fold_right f [a1; ...; an] b</code> is
   <code class="code">f a1 (f a2 (... (f an b) ...))</code>.  Not tail-recursive.<br>
</div>
<br>
<a name="6_Iteratorsontwolists"></a>
<h6>Iterators on two lists</h6><br>
<pre><span class="keyword">val</span> <a name="VALiter2"></a>iter2 : <code class="type">f:('a -> 'b -> unit) -> 'a list -> 'b list -> unit</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.iter2 f [a1; ...; an] [b1; ...; bn]</code> calls in turn
   <code class="code">f a1 b1; ...; f an bn</code>.
   Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the two lists have
   different lengths.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmap2"></a>map2 : <code class="type">f:('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.map2 f [a1; ...; an] [b1; ...; bn]</code> is
   <code class="code">[f a1 b1; ...; f an bn]</code>.
   Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the two lists have
   different lengths.  Not tail-recursive.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrev_map2"></a>rev_map2 : <code class="type">f:('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.rev_map2 f l1 l2</code> gives the same result as
   <a href="ListLabels.html#VALrev"><code class="code"><span class="constructor">ListLabels</span>.rev</code></a><code class="code"> (</code><a href="ListLabels.html#VALmap2"><code class="code"><span class="constructor">ListLabels</span>.map2</code></a><code class="code"> f l1 l2)</code>, but is tail-recursive and
   more efficient.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfold_left2"></a>fold_left2 : <code class="type">f:('a -> 'b -> 'c -> 'a) -> init:'a -> 'b list -> 'c list -> 'a</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.fold_left2 f a [b1; ...; bn] [c1; ...; cn]</code> is
   <code class="code">f (... (f (f a b1 c1) b2 c2) ...) bn cn</code>.
   Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the two lists have
   different lengths.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfold_right2"></a>fold_right2 : <code class="type">f:('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> init:'c -> 'c</code></pre><div class="info">
<code class="code"><span class="constructor">List</span>.fold_right2 f [a1; ...; an] [b1; ...; bn] c</code> is
   <code class="code">f a1 b1 (f a2 b2 (... (f an bn c) ...))</code>.
   Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the two lists have
   different lengths.  Not tail-recursive.<br>
</div>
<br>
<a name="6_Listscanning"></a>
<h6>List scanning</h6><br>
<pre><span class="keyword">val</span> <a name="VALfor_all"></a>for_all : <code class="type">f:('a -> bool) -> 'a list -> bool</code></pre><div class="info">
<code class="code">for_all p [a1; ...; an]</code> checks if all elements of the list
   satisfy the predicate <code class="code">p</code>. That is, it returns
   <code class="code">(p a1) <span class="keywordsign">&amp;&amp;</span> (p a2) <span class="keywordsign">&amp;&amp;</span> ... <span class="keywordsign">&amp;&amp;</span> (p an)</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALexists"></a>exists : <code class="type">f:('a -> bool) -> 'a list -> bool</code></pre><div class="info">
<code class="code">exists p [a1; ...; an]</code> checks if at least one element of
   the list satisfies the predicate <code class="code">p</code>. That is, it returns
   <code class="code">(p a1) <span class="keywordsign">||</span> (p a2) <span class="keywordsign">||</span> ... <span class="keywordsign">||</span> (p an)</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfor_all2"></a>for_all2 : <code class="type">f:('a -> 'b -> bool) -> 'a list -> 'b list -> bool</code></pre><div class="info">
Same as <a href="ListLabels.html#VALfor_all"><code class="code"><span class="constructor">ListLabels</span>.for_all</code></a>, but for a two-argument predicate.
   Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the two lists have
   different lengths.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALexists2"></a>exists2 : <code class="type">f:('a -> 'b -> bool) -> 'a list -> 'b list -> bool</code></pre><div class="info">
Same as <a href="ListLabels.html#VALexists"><code class="code"><span class="constructor">ListLabels</span>.exists</code></a>, but for a two-argument predicate.
   Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the two lists have
   different lengths.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmem"></a>mem : <code class="type">'a -> set:'a list -> bool</code></pre><div class="info">
<code class="code">mem a l</code> is true if and only if <code class="code">a</code> is equal
   to an element of <code class="code">l</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmemq"></a>memq : <code class="type">'a -> set:'a list -> bool</code></pre><div class="info">
Same as <a href="ListLabels.html#VALmem"><code class="code"><span class="constructor">ListLabels</span>.mem</code></a>, but uses physical equality instead of structural
   equality to compare list elements.<br>
</div>
<br>
<a name="6_Listsearching"></a>
<h6>List searching</h6><br>
<pre><span class="keyword">val</span> <a name="VALfind"></a>find : <code class="type">f:('a -> bool) -> 'a list -> 'a</code></pre><div class="info">
<code class="code">find p l</code> returns the first element of the list <code class="code">l</code>
   that satisfies the predicate <code class="code">p</code>.
   Raise <code class="code"><span class="constructor">Not_found</span></code> if there is no value that satisfies <code class="code">p</code> in the
   list <code class="code">l</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfilter"></a>filter : <code class="type">f:('a -> bool) -> 'a list -> 'a list</code></pre><div class="info">
<code class="code">filter p l</code> returns all the elements of the list <code class="code">l</code>
   that satisfy the predicate <code class="code">p</code>.  The order of the elements
   in the input list is preserved.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfind_all"></a>find_all : <code class="type">f:('a -> bool) -> 'a list -> 'a list</code></pre><div class="info">
<code class="code">find_all</code> is another name for <a href="ListLabels.html#VALfilter"><code class="code"><span class="constructor">ListLabels</span>.filter</code></a>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALpartition"></a>partition : <code class="type">f:('a -> bool) -> 'a list -> 'a list * 'a list</code></pre><div class="info">
<code class="code">partition p l</code> returns a pair of lists <code class="code">(l1, l2)</code>, where
   <code class="code">l1</code> is the list of all the elements of <code class="code">l</code> that
   satisfy the predicate <code class="code">p</code>, and <code class="code">l2</code> is the list of all the
   elements of <code class="code">l</code> that do not satisfy <code class="code">p</code>.
   The order of the elements in the input list is preserved.<br>
</div>
<br>
<a name="6_Associationlists"></a>
<h6>Association lists</h6><br>
<pre><span class="keyword">val</span> <a name="VALassoc"></a>assoc : <code class="type">'a -> ('a * 'b) list -> 'b</code></pre><div class="info">
<code class="code">assoc a l</code> returns the value associated with key <code class="code">a</code> in the list of
   pairs <code class="code">l</code>. That is,
   <code class="code">assoc a [ ...; (a,b); ...] = b</code>
   if <code class="code">(a,b)</code> is the leftmost binding of <code class="code">a</code> in list <code class="code">l</code>.
   Raise <code class="code"><span class="constructor">Not_found</span></code> if there is no value associated with <code class="code">a</code> in the
   list <code class="code">l</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALassq"></a>assq : <code class="type">'a -> ('a * 'b) list -> 'b</code></pre><div class="info">
Same as <a href="ListLabels.html#VALassoc"><code class="code"><span class="constructor">ListLabels</span>.assoc</code></a>, but uses physical equality instead of
   structural equality to compare keys.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmem_assoc"></a>mem_assoc : <code class="type">'a -> map:('a * 'b) list -> bool</code></pre><div class="info">
Same as <a href="ListLabels.html#VALassoc"><code class="code"><span class="constructor">ListLabels</span>.assoc</code></a>, but simply return true if a binding exists,
   and false if no bindings exist for the given key.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmem_assq"></a>mem_assq : <code class="type">'a -> map:('a * 'b) list -> bool</code></pre><div class="info">
Same as <a href="ListLabels.html#VALmem_assoc"><code class="code"><span class="constructor">ListLabels</span>.mem_assoc</code></a>, but uses physical equality instead of
   structural equality to compare keys.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALremove_assoc"></a>remove_assoc : <code class="type">'a -> ('a * 'b) list -> ('a * 'b) list</code></pre><div class="info">
<code class="code">remove_assoc a l</code> returns the list of
   pairs <code class="code">l</code> without the first pair with key <code class="code">a</code>, if any.
   Not tail-recursive.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALremove_assq"></a>remove_assq : <code class="type">'a -> ('a * 'b) list -> ('a * 'b) list</code></pre><div class="info">
Same as <a href="ListLabels.html#VALremove_assoc"><code class="code"><span class="constructor">ListLabels</span>.remove_assoc</code></a>, but uses physical equality instead
   of structural equality to compare keys.  Not tail-recursive.<br>
</div>
<br>
<a name="6_Listsofpairs"></a>
<h6>Lists of pairs</h6><br>
<pre><span class="keyword">val</span> <a name="VALsplit"></a>split : <code class="type">('a * 'b) list -> 'a list * 'b list</code></pre><div class="info">
Transform a list of pairs into a pair of lists:
   <code class="code">split [(a1,b1); ...; (an,bn)]</code> is <code class="code">([a1; ...; an], [b1; ...; bn])</code>.
   Not tail-recursive.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcombine"></a>combine : <code class="type">'a list -> 'b list -> ('a * 'b) list</code></pre><div class="info">
Transform a pair of lists into a list of pairs:
   <code class="code">combine [a1; ...; an] [b1; ...; bn]</code> is
   <code class="code">[(a1,b1); ...; (an,bn)]</code>.
   Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the two lists
   have different lengths.  Not tail-recursive.<br>
</div>
<br>
<a name="6_Sorting"></a>
<h6>Sorting</h6><br>
<pre><span class="keyword">val</span> <a name="VALsort"></a>sort : <code class="type">cmp:('a -> 'a -> int) -> 'a list -> 'a list</code></pre><div class="info">
Sort a list in increasing order according to a comparison
   function.  The comparison function must return 0 if its arguments
   compare as equal, a positive integer if the first is greater,
   and a negative integer if the first is smaller (see Array.sort for
   a complete specification).  For example,
   <a href="Pervasives.html#VALcompare"><code class="code">compare</code></a> is a suitable comparison function.
   The resulting list is sorted in increasing order.
   <code class="code"><span class="constructor">List</span>.sort</code> is guaranteed to run in constant heap space
   (in addition to the size of the result list) and logarithmic
   stack space.
<p>

   The current implementation uses Merge Sort. It runs in constant
   heap space and logarithmic stack space.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstable_sort"></a>stable_sort : <code class="type">cmp:('a -> 'a -> int) -> 'a list -> 'a list</code></pre><div class="info">
Same as <a href="ListLabels.html#VALsort"><code class="code"><span class="constructor">ListLabels</span>.sort</code></a>, but the sorting algorithm is guaranteed to
   be stable (i.e. elements that compare equal are kept in their
   original order) .
<p>

   The current implementation uses Merge Sort. It runs in constant
   heap space and logarithmic stack space.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfast_sort"></a>fast_sort : <code class="type">cmp:('a -> 'a -> int) -> 'a list -> 'a list</code></pre><div class="info">
Same as <a href="List.html#VALsort"><code class="code"><span class="constructor">List</span>.sort</code></a> or <a href="List.html#VALstable_sort"><code class="code"><span class="constructor">List</span>.stable_sort</code></a>, whichever is faster
    on typical input.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmerge"></a>merge : <code class="type">cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list</code></pre><div class="info">
Merge two lists:
    Assuming that <code class="code">l1</code> and <code class="code">l2</code> are sorted according to the
    comparison function <code class="code">cmp</code>, <code class="code">merge cmp l1 l2</code> will return a
    sorted list containting all the elements of <code class="code">l1</code> and <code class="code">l2</code>.
    If several elements compare equal, the elements of <code class="code">l1</code> will be
    before the elements of <code class="code">l2</code>.
    Not tail-recursive (sum of the lengths of the arguments).<br>
</div>
</body></html>