elm-community / list-extra

Convenience functions for working with List.
http://package.elm-lang.org/packages/elm-community/list-extra/latest
MIT License
135 stars 58 forks source link

Add reverseSortBy #143

Closed Janiczek closed 3 years ago

Janiczek commented 3 years ago

Alternative name might be sortByDescending?

Notably this implementation doesn't call List.reverse.

Chadtech commented 3 years ago

Hey @Janiczek !

I made this benchmark https://ellie-app.com/cKKDPFjHsC9a1 and it looks like List.sortBy identity >> List.reverse is faster. But, since that is also the naive and obvious way of reversing a sort then maybe its not useful to have a helper for this.

Janiczek commented 3 years ago

@Chadtech I haven't benchmarked this, good thinking! If reverse-using variant is faster, let's not merge this then 👍💯