Skip to content

Fix unused imports warning #257

Open
@adithyaov

Description

@adithyaov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions