alunduil / alunduil/network-arbitrary
Generator modules carry no dead imports or commented-out code
- 主要语言
- Haskell
- 星标
- 1
- 派生
- 2
- 平均合并
- 1 小时 37 分钟
- 30 天内合并 PR
- 10
描述
## Summary
Drop two redundant imports that GHC already flags, and resolve the commented-out `ipvFuture` generator, so `src/` builds warning-free.
## Motivation
`cabal build all` emits two `-Wunused-imports` (GHC-66111) warnings on every build. The `ipvFuture` generator has been commented out since it was first written in 3515b71 (2018-01-05).
Found while working #117; filed separately to keep that PR to the devcontainer deletion.
## Scope
Redundant imports in `src/Network/HTTP/Media/MediaType/Arbitrary.hs`. Both operators are used — `<$>` and `<*>` appear at lines 55-73 — but `import Prelude hiding (concat)` at line 43 already re-exports them, so the explicit imports add nothing:
- Line 12: `import Control.Applicative ((<*>))`
- Line 26: `import Data.Functor ((<$>))`
Commented-out code in `src/Network/URI/Arbitrary.hs`:
- Lines 114-120: the `ipvFuture` generator.
- Line 110: its commented call site, `-- , ipvFuture`.
## Open questions
The `ipvFuture` block is preceded by `TODO Check that "Network.URI" implements this correctly.` Deleting the block discards that recorded gap — RFC 3986 `IPvFuture` literals are not generated, and whether `Network.URI` handles them is still unverified. Either delete the block and file the coverage gap as its own issue, or leave it until the gap is settled.
Removing line 110 also leaves `oneof [ipv6Address]`, a single-element alternation. It can collapse to `x <- ipv6Address`, though the `oneof` does record that this is an RFC alternation with one implemented branch.
## Acceptance criteria
- [ ] `cabal build all` emits no `-Wunused-imports` warnings.
- [ ] The `ipvFuture` question is resolved — block deleted with the coverage gap tracked, or explicitly left with a reason.
- [ ] `cabal test all` still passes.
## Additional context
Adjacent to #116, which triages the hlint `extra` and `partial-strict` hint groups. Neither finding here would surface there: the redundant imports come from GHC's own `-Wunused-imports`, and hlint does not read comments.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。