haskell / network-uri

URI manipulation facilities
Other
24 stars 33 forks source link

Fixed unused import for newer GHC versions #53

Closed flip111 closed 4 years ago

flip111 commented 4 years ago

Got this warning during compiling

network-uri                > [2 of 3] Compiling Network.URI.Lens    
network-uri                >                                        
network-uri                > /tmp/stack22672/network-uri-2.6.2.0/Network/URI/Lens.hs:14:1: warning: [-Wunused-imports]
network-uri                >     The import of ‘Control.Applicative’ is redundant
network-uri                >       except perhaps to import instances from ‘Control.Applicative’
network-uri                >     To import instances alone, use: import Control.Applicative()
network-uri                >    |                                   
network-uri                > 14 | import           Control.Applicative
network-uri                >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
network-uri                > [3 of 3] Compiling Network.URI.Static  

Pretty sure this import is not needed all the way back to GHC 7.10

Was not entirely sure whether to keep compatibility with even older GHC versions so made a pragma instead of deleting this line

ezrakilty commented 4 years ago

Could you share which GHC version produced the original error?

ezrakilty commented 4 years ago

Oh I see—it was happening with all versions 7.10 or newer, wasn't it? The PR breaks compatibility with 7.2–7.8, so I'm redoing it with a different version in the CPP condition. Thanks for the report.

flip111 commented 4 years ago

Yes sorry i put the wrong condition. It should be 710 instead of 701.

The commit message is wrong, but i don't care about it (just saying in case you do care)

Suppress a warning in older GHCs, as pointed out by github user @flip111

Should be: Suppress a warning in GHC since 7.10, as pointed out by github user @flip111

Oh I see—it was happening with all versions 7.10 or newer, wasn't it?

Yes, before that i didn't test

ezrakilty commented 4 years ago

So I think this is resolved with 41ab335802f2808e24977a2e7b5a1665c2e3dd3c. Thanks for the report.

Oh yes, I got the commit message wrong. I don't think I can change it though; if it goes in the CHANGELOG I'll try to get it right!