alunduil / alunduil/network-arbitrary

Generator modules carry no dead imports or commented-out code

Ouverte
#142 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Haskell
Étoiles
1
Forks
2
Merge moyen
1 h 37 min
PR mergées (30 j)
10

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.