I think it's more complicated because he doesn't know what the return type or arity of the function is. In QuickCheck they know the return type of a property is Bool. In this case, we only know<span></span> that the return type is an instance of Show. I don't think that's enough to simply implement this. <br>
<br>On Sunday, January 13, 2013, Stephen Tetley wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes - I was just checking the first QuickCheck paper to see how the<br>
authors did this.<br>
<br>
You would need a new type class that works like `Testable` and the<br>
versions of associated machinery `forAll` and `evaluate` to unroll<br>
function application.<br>
<br>
<br>
On 13 January 2013 09:28, Roman Cheplyaka <<a href="javascript:;" onclick="_e(event, 'cvml', 'roma@ro-che.info')">roma@ro-che.info</a>> wrote:<br>
<br>
><br>
> This can be done with relatively simple type class hackery. In fact,<br>
> QuickCheck already does that in order to generate arguments and print<br>
> them in case of failure.<br>
><br>
> Roman<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Haskell-Cafe@haskell.org')">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote>