使用 quickCheckAll 和 GHC 7.10.1 RC1 的问题
Issue using quickCheckAll and GHC 7.10.1 RC1
以下示例使用 GHC 7.8.4 和 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
使用 GHC 7.10.1 RC 1,出现以下错误:
$ 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
我可以使用一些条件编译来修复示例吗?或者问题与 QuickCheck 库有关?
问题已在 QuickCheck 中修复(参见 https://github.com/nick8325/quickcheck/issues/42)。
以下示例使用 GHC 7.8.4 和 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
使用 GHC 7.10.1 RC 1,出现以下错误:
$ 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
我可以使用一些条件编译来修复示例吗?或者问题与 QuickCheck 库有关?
问题已在 QuickCheck 中修复(参见 https://github.com/nick8325/quickcheck/issues/42)。