package server-reason-react
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7811cd16a7256edbebd06057072142fc2fa1d81de784442e21f3225f06f08ce2
sha512=d60084b34f4086bc401f5f1e209714ab297b5dd94b9b55050816ba9dd0579b2c88745b1813ab57d9584c826af9602df279e8ecfdc04cde62f94d1fec9506dd45
doc/server-reason-react.belt/Belt/MutableSet/N/S/index.html
Module N.S
A module for Array sort relevant utiliites
Specalized when key type is string, more efficient than the generic type
strictlySortedLenght xs cmp return +n means increasing order -n means negative order
strictlySortedLength [| 1; 2; 3; 4; 3 |] (fun x y -> x < y) = 4;;
strictlySortedLength [||] (fun x y -> x < y) = 0;;
strictlySortedLength [| 1 |] (fun x y -> x < y) = 1;;
strictlySortedLength [| 4; 3; 2; 1 |] (fun x y -> x < y) = -4stableSortBy xs cmp
Sort xs in place using comparator cmp, the stable means if the elements are equal, their order will be preserved
stableSort xs cmp
The same as stableSortInPlaceBy except that xs is not modified
If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value.
If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1)
for example, if key is smaller than all elements return -1 since lnot (-1) = 0 if key is larger than all elements return - (len + 1) since lnot (-(len+1)) = len
binarySearchBy [| 1; 2; 3; 4; 33; 35; 36 |] 33 = 4;;
lnot (binarySearchBy [| 1; 3; 5; 7 |] 4) = 2