lspitzner / lspitzner/pqueue

Switch testing from sortOn to sortWith

Open
#113 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

testing
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.