Skip to content

Conversation

@mpscholten
Copy link
Member

Summary

  • Add -Werror=unused-imports to the 20 packages that only had -Werror=incomplete-patterns
  • All 26 packages now consistently treat unused imports as hard errors
  • No existing violations — all packages were pre-checked with -Wunused-imports in ghci

Test plan

  • Verified all 26 cabal files now have -Werror=unused-imports
  • Loaded representative modules from each package in ghci with -Wunused-imports — no violations
  • CI passes nix flake check

🤖 Generated with Claude Code

6 packages already had this flag; add it to the remaining 20 so unused
imports are caught as hard errors across the entire monorepo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mpscholten mpscholten force-pushed the add-werror-unused-imports branch from e51b665 to d7da431 Compare February 10, 2026 21:30
mpscholten and others added 27 commits February 10, 2026 22:33
Redundant under GHC2021 — `maybe` and `fmap` are re-exported from Prelude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restore Data.Either import for Right constructor (needed with
NoImplicitPrelude) and add Test.Postgres.Support () imports for
the orphan Eq Action instance needed by shouldBe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Serialize class is accessed through the qualified import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
void is in GHC2021 Prelude, HasField is in GHC2021.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HasField is included in GHC2021 Prelude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GHC2021 enables HasField but does not re-export the class from
Prelude — explicit import is required when used by name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Data.Proxy redundant in ModelSupport/Types (re-exported by GHC2021)
- GHC.OverloadedLabels redundant in Record (enabled by GHC2021)
- System.IO.Unsafe unused in RequestVault/Helper
- Prelude redundant in Static (nothing used beyond GHC2021 built-ins)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Hasql/Encoders: remove unused ByteString qualified, Data.Word,
  >$< from Contravariant, Vector qualified
- Hasql/FromRow: remove unused sepBy from Attoparsec
- Controller/Session: remove redundant GHC.Records and unused Id
- HaskellSupport: remove unused GHC.Records qualified
- RequestVault/ModelContext: remove redundant Prelude import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- NameSupport.hs: remove unused qualified Data.Char
- Tailwind.hs: remove duplicate Data.Default import, remove unused IHP.ModelSupport.Types
- Bootstrap.hs: remove duplicate Data.Default import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove redundant imports flagged by GHC 9.10:
- Data.Hashable, Control.DeepSeq, Data.List, Data.ByteString.Char8
- Database.PostgreSQL.Simple.ToField (both unqualified and qualified)
- Database.PostgreSQL.Simple.Types (qualified), FromRow (qualified), ToRow (qualified)
- Data.Time.Format.ISO8601, GHC.Types, Numeric, Data.Text.Encoding
- Duplicate Hasql.Errors import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Compiler.hs: remove redundant IHP.NameSupport import
- FrameworkConfig.hs: remove redundant Network.Wai import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- HasqlCompiler.hs: remove redundant Data.Int
- Filter.hs: remove redundant IHP.ModelSupport.Types, Data.Text, Hasql.DynamicStatements.Snippet (unqualified)
- RequestVault.hs: remove redundant Data.Proxy, Data.Typeable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Param.hs: remove 12 redundant imports (Data.Either, Wai.Request.Params.Middleware,
  Data.UUID, Data.ByteString.Char8, GHC.TypeLits, GHC.Float, Control.Exception,
  Data.Aeson.KeyMap, Data.Aeson.Key, Data.Scientific, Data.Vector, Text.Read)
- Context.hs: remove redundant IORef from Data.IORef, remove redundant
  qualified IHP.ControllerContext import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- FileUpload.hs: remove redundant IHP.Controller.Context
- ControllerSupport.hs: remove redundant Data.Text, RequestBody from
  Wai.Request.Params.Middleware, and unqualified IHP.Controller.Context import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- FileUpload.hs: restore IHP.Controller.Context import for instances
  (HasField "parsedBody" instance needed)
- ControllerSupport.hs: keep ControllerContext(ControllerContext) import
  (used unqualified in type signatures), only remove customFieldsRef

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GHC 9.10 considers the unqualified import of ControllerContext redundant
(it's available via the qualified import). Rather than suppressing the
warning, qualify all uses as Context.ControllerContext.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, BasicAuth, AutoRefresh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…/Controller.hs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lude.hs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rollerPrelude

The hiding import hid the module's only export (setModal), so the
module re-export was already a no-op. setModal is still exported
directly via the qualified import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pport/Controller/Sessions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant