core icon indicating copy to clipboard operation
core copied to clipboard

`Array` sorting

Open lue-bird opened this issue 3 years ago • 2 comments

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.

lue-bird avatar May 28 '21 21:05 lue-bird

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

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

github-actions[bot] avatar May 28 '21 21:05 github-actions[bot]

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

andre-dietrich avatar Dec 14 '21 21:12 andre-dietrich