prop_evenNumberPlusOneIsOdd :: Integer -> Property prop_evenNumberPlusOneIsOdd x = even x ==> odd (x + 1)
如果要检查是否有一个先决条件成立,则可以使用==>运算符。请注意,如果任意输入很难满足前提条件,则QuickCheck可以尽早放弃。
prop_overlySpecific x y = x == 0 ==> x * y == 0 ghci> quickCheck prop_overlySpecific *** Gave up! Passed only 31 tests.