使用 implication() 檢查具有前置條件的屬性

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.