serokell / universum

:milky_way: Prelude written in @Serokell
MIT License
176 stars 28 forks source link

Add 'sortNub' and 'unstableNub' to 'universum' #68

Closed chshersh closed 6 years ago

chshersh commented 7 years ago

Results in PR #66 show next things:

  1. hashNub is faster than ordNub when there're not so many different keys.
  2. When you're using Text data type than hashNub is faster.
  3. sortNub = Set.toList . Set.fromList has better performance than ordNub but should be used when you also need sorting.
  4. unstableNub = HashSet.toList . HashSet.fromList has better performance than hashNub.

So, all new functions should be added to universum and documented properly with use cases and examples.

@vrom911 Tell me if you have interest in implementing this issue as well :)

vrom911 commented 7 years ago

I'm interested! :)