[Haskell-cafe] GHC's -fwarn-unused-imports ignores
function signatures
Martijn van Steenbergen
martijn at van.steenbergen.nl
Wed Jan 28 11:33:18 EST 2009
This is a bug in GHC. See:
http://hackage.haskell.org/trac/ghc/ticket/2267
I have the same problem in several of my source files. :-(
Michael Snoyman wrote:
> I was writing code similar to the following and compiling with "-Wall
> -Werror." Clearly I *am* using Data.ByteString for the function signatures.
>
> {-# OPTIONS_GHC -fwarn-unused-imports -Werror #-}
> import qualified Data.ByteString as B
> import qualified Data.ByteString.UTF8 as BU
>
> toString :: B.ByteString -> String
> toString = BU.toString
>
> fromString :: String -> B.ByteString
> fromString = BU.fromString
>
> main :: IO ()
> main = putStrLn $ toString $ fromString "Hello World!"
>
>
> The warning I get is:
>
>
> Unused.hs:2:0:
> Warning: Module `Data.ByteString' is imported, but nothing from it
> is used,
> except perhaps instances visible in `Data.ByteString'
> To suppress this warning, use: import Data.ByteString()
>
>
>
> Am I doing something wrong or is this a bug in GHC?
>
> Thanks,
> Michael
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list