1Sort(3) OCamldoc Sort(3)
2
3
4
6 Sort - Sorting and merging lists.
7
9 Module Sort
10
12 Module Sort
13 : sig end
14
15
16 Deprecated. This module is obsolete and exists only for backward com‐
17 patibility. The sorting functions in Array and List should be used
18 instead. The new functions are faster and use less memory.
19
20
21 Sorting and merging lists.
22
23
24
25
26
27
28 val list : ('a -> 'a -> bool) -> 'a list -> 'a list
29
30 Sort a list in increasing order according to an ordering predicate.
31 The predicate should return true if its first argument is less than or
32 equal to its second argument.
33
34
35
36 val array : ('a -> 'a -> bool) -> 'a array -> unit
37
38 Sort an array in increasing order according to an ordering predicate.
39 The predicate should return true if its first argument is less than or
40 equal to its second argument. The array is sorted in place.
41
42
43
44 val merge : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list
45
46 Merge two lists according to the given predicate. Assuming the two
47 argument lists are sorted according to the predicate, merge returns a
48 sorted list containing the elements from the two lists. The behavior is
49 undefined if the two argument lists were not sorted.
50
51
52
53
54
552018-04-14 source: Sort(3)