[Haskell-cafe] GHC's -fwarn-unused-imports ignores function signatures

Michael Snoyman michael at snoyman.com
Wed Jan 28 11:06:07 EST 2009

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:

    Warning: Module `Data.ByteString' is imported, but nothing from it is
               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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090128/a3e9a5c6/attachment.htm

More information about the Haskell-Cafe mailing list