Closed exorcist365 closed 2 years ago
Mh, I wonder why the CI didn't catch this?
Mh, I wonder why the CI didn't catch this?
Same reason import Data.List (head)
doesn't generate a warning despite head
already being imported from Prelude, I think. (Not that I know what that reason is precisely.)
Same reason
import Data.List (head)
doesn't generate a warning despitehead
already being imported from Prelude, I think. (Not that I know what that reason is precisely.)
But it does, right?
$ cat test.hs
module Main where
import Data.List (head)
main :: IO ()
main = print $ head ['a'..]
$ ghc -Wall test.hs
Loaded package environment from /home/slot/.ghc/x86_64-linux-8.10.7/environments/default
[1 of 1] Compiling Main ( test.hs, test.o )
test.hs:3:1: warning: [-Wunused-imports]
The import of ‘Data.List’ is redundant
except perhaps to import instances from ‘Data.List’
To import instances alone, use: import Data.List()
|
3 | import Data.List (head)
| ^^^^^^^^^^^^^^^^^^^^^^^
Linking test ...
GHC 8.4 does not, and it's the only one for which we enable -Wunused-imports
.
(But yeah, you almost got me here. :-))
GHC 8.4 does not, and it's the only one for which we enable
-Wunused-imports
.
Oh; interesting that something (seemingly) so fundamental was reworked that recently
Description
Unused imports bad
Checklist
[x] I've read CONTRIBUTING.md
[x] I've considered how to best test these changes (property, unit, manually, ...) and concluded: XXX
- [ ] I updated theCHANGES.md
file