Header menu logo Fabulous.AST

Array Module

Functions and values

Function or value Description

appendOne v arr

Full Usage: appendOne v arr

Parameters:
    v : 'v
    arr : 'v array

Returns: 'v[]
Modifiers: inline
Type parameters: 'v
v : 'v
arr : 'v array
Returns: 'v[]

sortInPlace getKey attrs

Full Usage: sortInPlace getKey attrs

Parameters:
    getKey : 'T -> 'V
    attrs : 'T[]

Returns: 'T[]
Modifiers: inline
Type parameters: 'T, 'V

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

getKey : 'T -> 'V
attrs : 'T[]
Returns: 'T[]

Type something to start searching.