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 & sortBy
An example use-case is finding an Arrays 5 biggest numbers.
I miss sorting operations like
sort,sortBy&sortWithinListthe most when working with arrays.I think these would be worth adding to
elm/core'sArraymodule. Until anything gets decided,array-extracould just copyLists sorting API:An example use-case is finding an
Arrays 5 biggest numbers.