Unused import warnings.

Hi Cafe. I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports:
Warning: Module `Test.QuickCheck' is imported, but nothing from it is used
Is there a way to suppress these warnings for a particular module by using a pragma directive or something similar? Thanks! - Lyndon

On 10 August 2010 22:22, Lyndon Maydwell
Hi Cafe.
I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports:
Warning: Module `Test.QuickCheck' is imported, but nothing from it is used
Is there a way to suppress these warnings for a particular module by using a pragma directive or something similar?
You can do: import Test.QuickCheck ()

I'm using qualified properties with (import Test.QuickCheck ((==>)))
so that may not be possible.
On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done
On 10 August 2010 22:22, Lyndon Maydwell
wrote: Hi Cafe.
I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports:
Warning: Module `Test.QuickCheck' is imported, but nothing from it is used
Is there a way to suppress these warnings for a particular module by using a pragma directive or something similar?
You can do:
import Test.QuickCheck ()

On 10 August 2010 22:25, Lyndon Maydwell
On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done
wrote: On 10 August 2010 22:22, Lyndon Maydwell
wrote: Hi Cafe.
I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports:
Warning: Module `Test.QuickCheck' is imported, but nothing from it is used
Is there a way to suppress these warnings for a particular module by using a pragma directive or something similar?
You can do:
import Test.QuickCheck ()
I'm using qualified properties with (import Test.QuickCheck ((==>))) so that may not be possible.
Ah, ok. In that case you can use -fno-warn-unused-imports. You can pass that to GHC, or put it in as an OPTIONS pragma: {-# OPTIONS -fno-warn-unused-imports #-}

Is there a way to just ignore the warnings for QuickCheck?
On Wed, Aug 11, 2010 at 4:32 AM, Christopher Done
On 10 August 2010 22:25, Lyndon Maydwell
wrote: On Wed, Aug 11, 2010 at 4:23 AM, Christopher Done
wrote: On 10 August 2010 22:22, Lyndon Maydwell
wrote: Hi Cafe.
I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports:
Warning: Module `Test.QuickCheck' is imported, but nothing from it is used
Is there a way to suppress these warnings for a particular module by using a pragma directive or something similar?
You can do:
import Test.QuickCheck ()
I'm using qualified properties with (import Test.QuickCheck ((==>))) so that may not be possible.
Ah, ok. In that case you can use -fno-warn-unused-imports. You can pass that to GHC, or put it in as an OPTIONS pragma:
{-# OPTIONS -fno-warn-unused-imports #-}

Are you saying that GHC complains about an unused import that is in fact used? Perhaps you've run into this bug: http://hackage.haskell.org/trac/ghc/ticket/1148 Are you using a recent version of GHC? Groetjes, Martijn. On 8/10/10 22:22, Lyndon Maydwell wrote:
Hi Cafe.
I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports:
Warning: Module `Test.QuickCheck' is imported, but nothing from it is used
Is there a way to suppress these warnings for a particular module by using a pragma directive or something similar?
Thanks!
- Lyndon _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Fantastic. It was the bug mentioned.
On Wed, Aug 11, 2010 at 5:00 AM, Martijn van Steenbergen
Are you saying that GHC complains about an unused import that is in fact used? Perhaps you've run into this bug: http://hackage.haskell.org/trac/ghc/ticket/1148
Are you using a recent version of GHC?
Groetjes,
Martijn.
On 8/10/10 22:22, Lyndon Maydwell wrote:
Hi Cafe.
I have written some QuickCheck properties in my source and am using these for testing, however, when I compile my program I get warned about unused imports:
Warning: Module `Test.QuickCheck' is imported, but nothing from it is used
Is there a way to suppress these warnings for a particular module by using a pragma directive or something similar?
Thanks!
- Lyndon _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Christopher Done
-
Lyndon Maydwell
-
Martijn van Steenbergen