1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
2001-12-07 05:41:02 -08:00
|
|
|
(* under the terms of the GNU Library General Public License, with *)
|
|
|
|
(* the special exception on linking described in file ../LICENSE. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
2001-10-26 16:33:00 -07:00
|
|
|
(** Sorting and merging lists.
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2001-11-27 07:06:34 -08:00
|
|
|
@deprecated This module is obsolete and exists only for backward
|
|
|
|
compatibility.
|
2001-10-26 16:33:00 -07:00
|
|
|
The sorting functions in {!Array} and {!List} should be used instead.
|
2000-04-14 03:05:33 -07:00
|
|
|
The new functions are faster and use less memory.
|
|
|
|
*)
|
|
|
|
|
2001-12-03 14:16:03 -08:00
|
|
|
val list : ('a -> 'a -> bool) -> 'a list -> 'a list
|
2001-10-26 16:33:00 -07:00
|
|
|
(** Sort a list in increasing order according to an ordering predicate.
|
|
|
|
The predicate should return [true] if its first argument is
|
|
|
|
less than or equal to its second argument. *)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2001-12-03 14:16:03 -08:00
|
|
|
val array : ('a -> 'a -> bool) -> 'a array -> unit
|
2001-10-26 16:33:00 -07:00
|
|
|
(** Sort an array in increasing order according to an
|
|
|
|
ordering predicate.
|
|
|
|
The predicate should return [true] if its first argument is
|
|
|
|
less than or equal to its second argument.
|
|
|
|
The array is sorted in place. *)
|
1999-02-26 09:58:33 -08:00
|
|
|
|
2001-12-03 14:16:03 -08:00
|
|
|
val merge : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list
|
2001-10-26 16:33:00 -07:00
|
|
|
(** Merge two lists according to the given predicate.
|
|
|
|
Assuming the two argument lists are sorted according to the
|
|
|
|
predicate, [merge] returns a sorted list containing the elements
|
|
|
|
from the two lists. The behavior is undefined if the two
|
|
|
|
argument lists were not sorted. *)
|