Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to falsify commutativity of function composition with QuickCheck
    text
    copied!<ol> <li><p>What is ex that should be pass to CoArbitrary of the following code?</p></li> <li><p>How to use Function in Test.QuickCheck.Function to represent f and g in proposition?</p></li> <li><p>is it correct to write , if not, how?</p> <p>where types = [f, g] :: [Function] </p></li> <li><p>Can variant accept Function ? as i know generate function often use >&lt; or variant which stated in the source code of QuickCheck</p></li> </ol> <p>The error:</p> <pre><code>&lt;interactive&gt;:1:12: No instance for (Eq (b0 -&gt; b0)) arising from a use of `prop_commutative' Possible fix: add an instance declaration for (Eq (b0 -&gt; 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 </code></pre> <p>[Updated] </p> <p>but it is not implemented CoArbitrary <a href="http://www.google.com.hk/url?sa=t&amp;rct=j&amp;q=QuickCheck+meiser.pdf&amp;source=web&amp;cd=1&amp;ved=0CBwQFjAA&amp;url=http%3A%2F%2Fwww.st.cs.uni-saarland.de%2Fedu%2Fseminare%2F2005%2Fadvanced-fp%2Fslides%2Fmeiser.pdf&amp;ei=hhfHTo_ZDdCciAethMjqDw&amp;usg=AFQjCNFF467CXacWGMkN8jvgqatkcLcVcg" rel="nofollow">http://www.google.com.hk/url?sa=t&amp;rct=j&amp;q=QuickCheck+meiser.pdf&amp;source=web&amp;cd=1&amp;ved=0CBwQFjAA&amp;url=http%3A%2F%2Fwww.st.cs.uni-saarland.de%2Fedu%2Fseminare%2F2005%2Fadvanced-fp%2Fslides%2Fmeiser.pdf&amp;ei=hhfHTo_ZDdCciAethMjqDw&amp;usg=AFQjCNFF467CXacWGMkN8jvgqatkcLcVcg</a></p> <p>Another writing mimic the example in Function, parse error at '=' in ghci <code>let prop_commutative (Fun _ f) (Fun _ g) = (f.g) == (g.f)</code> can run</p> <p>The code:</p> <pre><code>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 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload