alunduil / alunduil/network-arbitrary

Generator modules carry no dead imports or commented-out code

Abierto
#142 0 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Haskell
Estrellas
1
Forks
2
Merge medio
1 h 37 min
PR fusionados (30 d)
10

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.