I wonder why there is Belt.SortArray.stableSortBy
instead of simply Belt.Array.sort
similar to Belt.List.sort
reference How do I sort Array? - #4 by imjoshellis
I wonder why there is Belt.SortArray.stableSortBy
instead of simply Belt.Array.sort
similar to Belt.List.sort
reference How do I sort Array? - #4 by imjoshellis
IIRC, this is due to historic reasons.
The stableSort is used by the map, when we cut the size as small as possible.