1Sort(3) OCaml library 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 Sorting and merging lists.
21
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
37 val array : ('a -> 'a -> bool) -> 'a array -> unit
38
39 Sort an array in increasing order according to an ordering predicate.
40 The predicate should return true if its first argument is less than or
41 equal to its second argument. The array is sorted in place.
42
43
44
45
46 val merge : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list
47
48 Merge two lists according to the given predicate. Assuming the two
49 argument lists are sorted according to the predicate, merge returns a
50 sorted list containing the elements from the two lists. The behavior is
51 undefined if the two argument lists were not sorted.
52
53
54
55
56
57
58OCamldoc 2017-03-22 Sort(3)