lspitzner / lspitzner/pqueue

one PQueue datatype with type parameter for priority order

Open
#8 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Haskell
Stars
17
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Currently you define `MaxPQueue` as wrapper around `MinPQueue`. I would prefer a general `PQueue` data type with a type parameter that chooses between the Min and Max variant.
That would save the wrapper code in `Data.PQueue.Max` and code duplication in custom utility functions.
I think it can still be Haskell 98 with definitions like these:
~~~~
class Dir dir where dirCompare :: (Ord a) => dir -> a -> a -> Ordering
data Min = Min; instance Dir Min where dirCompare Min = compare
data Max = Max; instance Dir Max where dirCompare Max = flip compare
~~~~

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

Start by reviewing the existing MaxPQueue wrapper in Data.PQueue.Max and the custom utility functions mentioned in the issue. Compare their behavior with the proposed parameterized PQueue design; done means Min and Max behavior are preserved while the wrapper and duplicated utilities are no longer needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.