alunduil / alunduil/network-arbitrary

Generator modules carry no dead imports or commented-out code

Aperta
#142 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Haskell
Stelle
1
Fork
2
Merge medio
1h 37m
PR unite (30g)
10

Descrizione

## 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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.