-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
I miss sorting operations like sort, sortBy & sortWith in List the most when working with arrays.
I think these would be worth adding to elm/core's Array module. Until anything gets decided, array-extra could just copy Lists sorting API:
sortWith : (a -> a -> Order) -> Array a -> Array a
sortWith elementOrder array =
array
|> Array.toList
|> List.sortWith elementOrder
|> Array.fromList
-- same with sort & sortByAn example use-case is finding an Arrays 5 biggest numbers.