下面的法典应该通过什么?
• 如何使用测试功能。
如果不是的话,如何写?
• 类型=[f、g] [职能]
备选案文能否接受功能? (一) 通常产生功能;和 检查
错误:
<interactive>:1:12:
No instance for (Eq (b0 -> b0))
arising from a use of `prop_commutative
Possible fix: add an instance declaration for (Eq (b0 -> b0))
In the first argument of `quickCheck , namely `prop_commutative
In the expression: quickCheck prop_commutative
In an equation for `it : it = quickCheck prop_commutative
[更新]
图2
Another writing mimic the example in Function, parse error at =
in ghci let prop_commutative (Fun _ f) (Fun _ g) = (f.g) == (g.f)
can run
守则:
import Test.QuickCheck.Function
import Test.QuickCheck.Gen
import Test.QuickCheck
let prop_commutative (Fun _ f) (Fun _ g) = (f.g) == (g.f)
main = quickCheck prop_commutative