haskell / haskell/primitive

Fix unused imports warning

Open
#257 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
123
Forks
60
PR merge metrics
No merged PRs in 30d

Description

This is not a major problem but ideally, it's good to fix all the warnings.
We can come up with a protocol to deal with it.

For example, In `Data.Primitive.Array` the conditionals are as follows,
```
-- base < 4.8.0 then import Data.Traversable (Traversable(..))
-- base < 4.8.0 then import Data.Monoid
-- base < 4.10.0 then import GHC.Base (runRW#)

-- base >= 4.4.0 then import Control.Monad.Zip
-- base >= 4.7.0 then import GHC.Exts hiding (toList)
-- base >= 4.7.0 then import GHC.Exts (fromListN, fromList)
-- base >= 4.8.0 then import Data.Functor.Identity
-- base >= 4.9.0 then import qualified GHC.ST as GHCST
-- base >= 4.9.0 then import qualified Data.Foldable as F
-- base >= 4.9.0 then import Data.Semigroup
-- base >= 4.10.0 then import GHC.Exts (runRW#)

-- base >= 4.9.0 || transformers >= 0.4.0
-- then import Data.Functor.Classes (Eq1(..),Ord1(..),Show1(..),Read1(..))
```

It would be nice to come up with a proper method for writing imports so that it is minimally complete. We should make sure not to import any additional modules or reimport the same module in multiple conditionals.

This is a general problem but fixing it in this library would be a good start.

We should probably try to maximize the use of qualified imports.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the conditional imports in Data.Primitive.Array and the unused-import warnings they produce. Review the base and transformers version branches, then audit the library's other imports; done means no unnecessary modules or duplicate conditional imports while preserving the required compatibility branches.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.