Array Module
Functions and values
| Function or value |
Description
|
Full Usage:
appendOne v arr
Parameters:
'v
arr : 'v array
Returns: 'v array
Modifiers: inline Type parameters: 'v |
|
Full Usage:
sortInPlace getKey attrs
Parameters:
'T -> 'V
attrs : 'T[]
Returns: 'T[]
Modifiers: inline Type parameters: 'T, 'V (requires comparison) |
This is insertion sort that is O(n*n) but it performs better 1. if the array is partially sorted (second sort is cheap) 2. there are few elements, we expect to have only a handful of them per widget 3. stable, which is handy for duplicate attributes, e.g. we can choose which one to pick https://en.wikipedia.org/wiki/Insertion_sort
|
Fabulous.AST