 a suitable comparison function.
   The resulting list is sorted in increasing order.
   <a href="List.html#VALsort"><code class="code">List.sort</code></a> is guaranteed to run in constant heap space
   (in addition to the size of the result list) and logarithmic
   stack space.</p>

<p>The current implementation uses Merge Sort. It runs in constant
   heap space and logarithmic stack space.</p>
</div>
</div>

<pre id="VALstable_sort">val stable_sort : ('a -&gt; 'a -&gt; int) -&gt; 'a list -&gt; 'a list</p