1
+ (* ```res prelude
2
+ * type element = string
3
+ * ```
4
+ *)
1
5
2
6
# 2 " others/sort.cppo.mli"
3
7
(* Copyright (C) 2017 Authors of ReScript
25
29
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
26
30
27
31
28
- (* * This is a specialized module for [`Belt_SortArray`](), the docs in that module also
29
- applies here, except the comparator is fixed and inlined
32
+ (* *
33
+ This is a specialized module for `Belt.SortArray`, the docs in that module also
34
+ applies here, except the comparator is fixed and inlined.
30
35
*)
31
36
32
37
# 34 " others/sort.cppo.mli"
@@ -35,35 +40,34 @@ type element = string
35
40
# 39 " others/sort.cppo.mli"
36
41
val strictlySortedLength : element array -> int
37
42
(* *
38
- The same as [`Belt_SortArray. strictlySortedLength`]() except the comparator is fixed
43
+ The same as `Belt.SortArray. strictlySortedLength` except the comparator is fixed.
39
44
40
- **return** `+n` means increasing order `-n` means negative order
45
+ Returns `+n` means increasing order `-n` means negative order.
41
46
*)
42
47
43
48
44
49
val isSorted : element array -> bool
45
- (* * `sorted xs ` return true if `xs` is in non strict increasing order *)
50
+ (* * `isSorted(xs) ` return true if `xs` is in non strict increasing order. *)
46
51
47
52
val stableSortInPlace : element array -> unit
48
53
(* *
49
- The same as [`Belt_SortArray. stableSortInPlaceBy`]() except the comparator is fixed
54
+ The same as `Belt.SortArray. stableSortInPlaceBy` except the comparator is fixed.
50
55
*)
51
56
52
57
val stableSort : element array -> element array
53
- (* * The same as [`Belt_SortArray. stableSortBy`]() except the comparator is fixed *)
58
+ (* * The same as `Belt.SortArray. stableSortBy` except the comparator is fixed. *)
54
59
55
60
val binarySearch : element array -> element -> int
56
61
(* *
57
- If value is not found and value is less than one or more elements in array,
58
- the negative number returned is the bitwise complement of the index of the first element
62
+ If value is not found and value is less than one or more elements in array, the
63
+ negative number returned is the bitwise complement of the index of the first element
59
64
that is larger than value.
60
65
61
- If value is not found and value is greater than all elements in array,
62
- the negative number returned is the bitwise complement of
63
- (the index of the last element plus 1)
66
+ If value is not found and value is greater than all elements in array, the negative
67
+ number returned is the bitwise complement of (the index of the last element plus 1)
64
68
65
- for example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`
66
- if `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`
69
+ for example, if `key` is smaller than all elements return `-1` since `lnot(-1) = 0`
70
+ if `key` is larger than all elements return `- (len + 1)` since `lnot(-(len+1)) = len`.
67
71
*)
68
72
69
73
(* */**)
0 commit comments