elm / core

Elm's core libraries
http://package.elm-lang.org/packages/elm/core/latest
BSD 3-Clause "New" or "Revised" License
2.79k stars 359 forks source link

`Array` sorting #1112

Open lue-bird opened 3 years ago

lue-bird commented 3 years ago

Sorting operations like sort, sortBy & sortWith in List can't be found in the module Array. I miss them the most when working with Arrays, so I think these would be worth adding in a future release to supply a default way of sorting Arrays.

github-actions[bot] commented 3 years ago

Thanks for reporting this! To set expectations:

Finally, please be patient with the core team. They are trying their best with limited resources.

andre-dietrich commented 2 years ago

Hi, this would be a great feature. It seems to me, that the functionality is already there, since the array seems to be used for sorting lists. It only needs to be exposed also to the array module. I think something like this could also be relevant to create more performant statistics libraries ...

https://github.com/elm/core/blob/84f38891468e8e153fc85a9b63bdafd81b24664e/src/Elm/Kernel/List.js#L73-L86