`Size` can be a newtype.
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- haskell
- Domain
- performance
Research direction
Start by locating the Size definition and its Exact, Max, and Unknown constructors, then trace how Size is stored in Bundle and used by the relevant functions. Confirm that the proposed representation preserves the stated denotational equivalences and supports pattern synonyms, with Size unpacked where possible and no behavioral regressions.
Written by the indexing model from the issue text.
Description
The Exact and Max constructors require a nonnegative Int. Denotationally, Exact 0 is the same as Max 0. There's also unknown. This means you can fit an entire Size into the same space as an Int:
Exact nis represented by a non-negativen.Max nis represented by a negativen, wheren<=maxBound.UnknownisminBound, becauseminBound == negate minBound.
Doing so would allow Size to be unpacked in Bundle and various functions. Exact, Max, and Unknown can be pattern synonyms. I feel like this would improve performance somewhat.
- Dominant language
- Haskell
- Stars
- 401
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
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.
More from haskell/vector
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
doclayout-0.6 Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
commercialhaskell/stackage#8126 ·