[Haskell-cafe] GHC 7/Cabal request for help

John Goerzen jgoerzen at complete.org
Thu Mar 24 14:18:13 CET 2011

Hi folks,

I don't have a GHC 7 environment running yet (it's on my list...) but I 
received a bug report pointing me at this build failure:


Among other things, this noted:

Dependency QuickCheck >= using QuickCheck-

and the errors were:

[1 of 3] Compiling Test.QuickCheck.Instances ( 
src/Test/QuickCheck/Instances.hs, dist/build/Test/QuickCheck/Instances.o )

     Duplicate instance declarations:
       instance Arbitrary Word8
         -- Defined at src/Test/QuickCheck/Instances.hs:39:10-24
       instance Arbitrary Word8 -- Defined in Test.QuickCheck.Arbitrary

     Duplicate instance declarations:
       instance CoArbitrary Word8
         -- Defined at src/Test/QuickCheck/Instances.hs:42:10-26
       instance CoArbitrary Word8 -- Defined in Test.QuickCheck.Arbitrary

Now, that's fairly standard, and in fact, in my code, is wrapped with:

#if MIN_VERSION_QuickCheck(2,3,0)
     -- we have Word8 instances here
instance Arbitrary Word8 where
     arbitrary = sized $ \n -> choose (0, min (fromIntegral n) maxBound)

instance CoArbitrary Word8 where
     coarbitrary n = variant (if n >= 0 then 2 * x else 2 * x + 1)
                 where x = abs . fromIntegral $ n

And that code has been working to support modern QuickCheck versions for 
some time.

It would appear that something in Cabal, GHC 7, or QuickCheck is 
breaking this check.


-- John

More information about the Haskell-Cafe mailing list