Provides the std sort package.
Package: std.sort
Reachable from entry: no
function isSorted(arr, lessFn)Checks whether an array is sorted according to the given comparator.
| Parameter | Type | Default | Description |
|---|---|---|---|
arr |
dynamic |
— | Value supplied for arr. |
lessFn |
dynamic |
— | Value supplied for lessFn. |
Source: std/sort.ml:226
function sort(arr)Stable in-place sort using the default comparator (ascending).
| Parameter | Type | Default | Description |
|---|---|---|---|
arr |
dynamic |
— | Value supplied for arr. |
Source: std/sort.ml:39
function sortBy(arr, lessFn)Stable in-place sort with a custom comparator and O(n log n) comparisons.
| Parameter | Type | Default | Description |
|---|---|---|---|
arr |
dynamic |
— | Value supplied for arr. |
lessFn |
dynamic |
— | Value supplied for lessFn. |
Source: std/sort.ml:46
function sortFast(arr)Faster in-place sort using the default comparator (ascending) - uses an iterative quicksort with insertion-sort fallback for small ranges - not guaranteed stable.
| Parameter | Type | Default | Description |
|---|---|---|---|
arr |
dynamic |
— | Value supplied for arr. |
Source: std/sort.ml:132
function sortFastBy(arr, lessFn)Faster in-place sort with a custom comparator - uses an iterative quicksort with insertion-sort fallback for small ranges - not guaranteed stable.
| Parameter | Type | Default | Description |
|---|---|---|---|
arr |
dynamic |
— | Value supplied for arr. |
lessFn |
dynamic |
— | Value supplied for lessFn. |
Source: std/sort.ml:139