-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unused imports warning #257
Comments
Good point!
…On Mon, Feb 10, 2020 at 4:35 AM Adithya Kumar ***@***.***> wrote:
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#257?email_source=notifications&email_token=AAABBQU2CGDSAQNKMYR4RG3RCENWFA5CNFSM4KSKTIF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IMGCHHA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQXYIJ3QDP4EPVY2E3LRCENWFANCNFSM4KSKTIFQ>
.
|
Out of curiosity, how did you run afoul if those warnings?
It’s moderately challenging to be perfectly warning clean across a large
range of supported versions.
In this case what makes you favor converting those imports to qualified
ones ?
On Mon, Feb 10, 2020 at 8:39 AM Carter Schonwald <[email protected]>
wrote:
… Good point!
On Mon, Feb 10, 2020 at 4:35 AM Adithya Kumar ***@***.***>
wrote:
> 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.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#257?email_source=notifications&email_token=AAABBQU2CGDSAQNKMYR4RG3RCENWFA5CNFSM4KSKTIF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IMGCHHA>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAABBQXYIJ3QDP4EPVY2E3LRCENWFANCNFSM4KSKTIFQ>
> .
>
|
I've currently used a few files in this library to fix a few version bounds for my project. The CI that my project is on fails even if there are warnings ( I've managed to fix the warnings in
I've not entirely thought this through, but I'll come up with a proper example with some modules in this library and get back to you. |
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,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.
The text was updated successfully, but these errors were encountered: