Switch testing from sortOn to sortWith
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 17
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
`Data.List.sortOn` uses a decorate-sort-undecorate algorithm. That's great when the passed function is expensive. But when it's very cheap, it just wastes time and space. In our tests, we have a bunch of `sortOn Down`. Since `Down` is just a coercion, this is lousy. We should instead use `GHC.Exts.sortWith`, which applies the passed function each time.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the test uses of Data.List.sortOn with Down, then compare them with GHC.Exts.sortWith. Replace the applicable test expressions and run the project's test suite; done means the tests use sortWith and continue to pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- performance, testing
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100