|
| 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
|
@@ -36,35 +40,34 @@ type element = string
|
36 | 40 | # 39 "others/sort.cppo.mli"
|
37 | 41 | val strictlySortedLength: element array -> int
|
38 | 42 | (**
|
39 |
| - The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed |
| 43 | + The same as `Belt.SortArray.strictlySortedLength` except the comparator is fixed. |
40 | 44 |
|
41 |
| - **return** `+n` means increasing order `-n` means negative order |
| 45 | + Returns `+n` means increasing order `-n` means negative order. |
42 | 46 | *)
|
43 | 47 |
|
44 | 48 |
|
45 | 49 | val isSorted: element array -> bool
|
46 |
| -(** `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. *) |
47 | 51 |
|
48 | 52 | val stableSortInPlace: element array -> unit
|
49 | 53 | (**
|
50 |
| - The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed |
| 54 | + The same as `Belt.SortArray.stableSortInPlaceBy` except the comparator is fixed. |
51 | 55 | *)
|
52 | 56 |
|
53 | 57 | val stableSort: element array -> element array
|
54 |
| -(** The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed *) |
| 58 | +(** The same as `Belt.SortArray.stableSortBy` except the comparator is fixed. *) |
55 | 59 |
|
56 | 60 | val binarySearch: element array -> element -> int
|
57 | 61 | (**
|
58 |
| - If value is not found and value is less than one or more elements in array, |
59 |
| - 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 |
60 | 64 | that is larger than value.
|
61 | 65 |
|
62 |
| - If value is not found and value is greater than all elements in array, |
63 |
| - the negative number returned is the bitwise complement of |
64 |
| - (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) |
65 | 68 |
|
66 |
| - for example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0` |
67 |
| - 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`. |
68 | 71 | *)
|
69 | 72 |
|
70 | 73 | (**/**)
|
|
0 commit comments