It does not seem like printing the result value from IO (), because with a more complicated example for lists.<div><br></div><div><div>t :: [a] -&gt; Bool</div><div>t x = True</div></div><div><br></div><div>then it randomly generates values of type [()].</div>
<div><br></div><div><div>*Quick&gt; verboseCheck t</div><div>0:</div><div>[]</div><div>1:</div><div>[()]</div><div>2:</div><div>[(),(),()]</div><div>3:</div><div>[]</div><div>4:</div><div>[()]</div><div>5:</div><div>[(),(),(),()]</div>
<div><br></div><div>I just wonder how the a got instantiated to ().</div><div><br></div><div>Thanks,</div><div>hugo</div><div><br></div><br><div class="gmail_quote">On Tue, Jun 17, 2008 at 11:05 AM, Dougal Stanton &lt;<a href="mailto:dougal@dougalstanton.net">dougal@dougalstanton.net</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">2008/6/17 Hugo Pacheco &lt;<a href="mailto:hpacheco@gmail.com">hpacheco@gmail.com</a>&gt;:<br>
<div class="Ih2E3d">&gt; Hi all,<br>
&gt; There is something about polymorphic tests in QuickCheck that I do not<br>
&gt; understand.<br>
&gt; If you write the simplest dummy test function<br>
&gt; tst :: a -&gt; Bool<br>
&gt; tst _ = True<br>
&gt; and evaluate it we get<br>
&gt;&gt; verboseCheck tst<br>
&gt; 0:<br>
&gt; ()<br>
&gt; 1:<br>
&gt; ()<br>
&gt; ...<br>
&gt; How come did the polymorphic value a get instanciated to ()? Is this done<br>
&gt; via the Testable type class?<br>
<br>
</div>I haven&#39;t got something here to check with, but from the formatting it<br>
looks like every odd line is a randomly-chosen boolean value, and the<br>
following line is the result? It might be just printing the result<br>
value of IO (). Maybe try a more complete test to see how that looks?<br>
<br>
Cheers,<br>
<br>
D<br>
<font color="#888888"><br>
<br>
--<br>
Dougal Stanton<br>
<a href="mailto:dougal@dougalstanton.net">dougal@dougalstanton.net</a> // <a href="http://www.dougalstanton.net" target="_blank">http://www.dougalstanton.net</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.di.uminho.pt/~hpacheco">www.di.uminho.pt/~hpacheco</a>
</div>