[RFC] Summarize contiguous version ranges
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
> I would prefer going further and attempt to summarize contiguous version ranges, even though this would be more work.
`[__0] rejecting: pandoc; 1.14 through 3.1.8`
_Originally posted by @gbaz in https://github.com/haskell/cabal/issues/9559#issuecomment-1868586636_
How would we summarize ranges? The suggestion above is very brief. How do I check that the solver has tried every version available?
Could we use something like [range extraction](https://rosettacode.org/wiki/Range_extraction#Haskell)? This is a bit more explicit.
How would this work with multiple levels of range? Would we show lower levels where each leaf is only a `.0` version? Is descending order readable for ranges?
```
3.0.2.0, 3.0.1.0, 3.0.0.0 => 3.0.{0-2}.0
```
Two lengthy examples to consider, `pandoc` and `Cabal`;
- `pandoc`
```
3.1.8, 3.1.7, 3.1.6.2, 3.1.6.1, 3.1.6, 3.1.5, 3.1.4,
3.1.3, 3.1.2, 3.1.1, 3.1, 3.0.1, 3.0, 2.19.2, 2.19.1, 2.19, 2.18, 2.17.1.1,
2.17.1, 2.17.0.1, 2.17, 2.16.2, 2.16.1, 2.16, 2.15, 2.14.2, 2.14.1, 2.14.0.3,
2.14.0.2, 2.14.0.1, 2.14, 2.13, 2.12, 2.11.4, 2.11.3.2, 2.11.3.1, 2.11.3,
2.11.2, 2.11.1.1, 2.11.1, 2.11.0.4, 2.11.0.2, 2.11.0.1, 2.11, 2.10.1, 2.10,
2.9.2.1, 2.9.2, 2.9.1.1, 2.9.1, 2.9, 2.8.1, 2.8.0.1, 2.8, 2.7.3, 2.7.2, 2.7.1,
2.7, 2.6, 2.5, 2.4, 2.3.1, 2.3, 2.2.3.2, 2.2.3.1, 2.2.3, 2.2.2.1, 2.2.2, 2.2.1,
2.2, 2.1.3, 2.1.2, 2.1.1, 2.1, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1.1,
2.0.1, 2.0.0.1, 2.0, 1.19.2.4, 1.19.2.3, 1.19.2.2, 1.19.2.1,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1.22.7.0, 1.22.6.0, 1.22.5.0, 1.22.4.0, 1.22.3.0, 1.22.2.0, 1.22.1.1,
1.22.1.0, 1.22.0.0, 1.20.0.4, 1.20.0.3, 1.20.0.2, 1.20.0.1, 1.20.0.0, 1.18.1.7,
1.18.1.6, 1.18.1.5, 1.18.1.4, 1.18.1.3, 1.18.1.2, 1.18.1.1, 1.18.1, 1.18.0,
1.16.0.3, 1.16.0.2, 1.16.0.1, 1.16.0, 1.14.0, 1.12.0, 1.10.2.0, 1.10.1.0,
1.10.0.0, 1.8.0.6, 1.8.0.4, 1.8.0.2, 1.6.0.3, 1.6.0.2, 1.6.0.1, 1.4.0.2,
1.4.0.1, 1.4.0.0, 1.2.4.0, 1.2.3.0, 1.2.2.0, 1.2.1, 1.1.6, 1.24.1.0
```
## Options
- ascending bounds `1.14 through 3.1.8`
- prefix `3.10.{2.1, 2.0, 1.0}`
- prefix with range extraction `3.10.{2.1-0, 1.0}`
- tree list
```
- 3
-- 10[2.1, 2.0, 1.0]
```
Contributor guide
Research direction
The issue names no files or tests; begin by locating the solver's version-rejection output and compare the pandoc and Cabal examples. Resolve the competing range formats, ordering, nesting, and completeness questions before implementation. Done means an agreed summary format that clearly represents contiguous versions and shows whether every available version was tried.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100