0

The following example compiles with GHC 7.8.4 and QuickCheck 2.7.6:

{-# LANGUAGE TemplateHaskell #-}

import Test.QuickCheck

prop_id :: Eq a => a -> Bool
prop_id x = x == x

-- Hack to make $quickCheckAll work under GHC >= 7.8.
return []

main :: IO Bool
main = $quickCheckAll

Using GHC 7.10.1 RC 1, I got the following error:

$ ghc Bug.hs
Bug.hs:12:8:
    Exception when trying to run compile-time code:
      Higher-kinded type variables in type: forall (a_0 :: *) . GHC.Classes.Eq a_0 => a_0 -> GHC.Types.Bool
    Code: quickCheckAll
   In the splice: $quickCheckAll

Can I fix the example using some conditional compilation? Or is the issue related to the QuickCheck library?

asr
  • 1,166
  • 6
  • 18
  • 2
    It definitely looks like some sort of Template Haskell issue. Are you using the bleeding-edge QuickCheck sources from git or darcs (whatever they use)? If not, try that. If so, report a bug. – dfeuer Jan 10 '15 at 16:26

1 Answers1

0

The issue was fixed in QuickCheck (see https://github.com/nick8325/quickcheck/issues/42).

asr
  • 1,166
  • 6
  • 18