xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 274 forks source link

X.H.BorderPerWindow: Remove unused import #660

Closed exorcist365 closed 2 years ago

exorcist365 commented 2 years ago

Description

Unused imports bad

Checklist

slotThe commented 2 years ago

Mh, I wonder why the CI didn't catch this?

liskin commented 2 years ago

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.)

slotThe commented 2 years ago

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.)

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 ...
liskin commented 2 years ago

GHC 8.4 does not, and it's the only one for which we enable -Wunused-imports. (But yeah, you almost got me here. :-))

slotThe commented 2 years ago

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