your quick check property (in a different way of writing) is the
following:<br>
<br>
<span style="font-family: courier new,monospace;">prop_1 :: Maybe Double
-> Bool</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">prop_1 v = v == v</span><br>
<br>
but what you want is actually the following:<br>
<br>
<span style="font-family: courier new,monospace;">prop_2 :: Maybe Double
-> Maybe Double -> Bool</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">prop_2 v1 v2 = v2 ==
v2</span><br>
<br>
if I understood the problem correctly, using prop_2 should
solve it. just run <a href="http://hackage.haskell.org/packages/archive/QuickCheck/1.1.0.0/doc/html/Test-QuickCheck.html#v:verboseCheck">verboseCheck</a>
on these two and observe the results.<br><br>
Best,<br>
<br><br><br><div class="gmail_quote">On 5 May 2010 08:47, Tim Docker <span dir="ltr"><<a href="mailto:twd2@dockerz.net">twd2@dockerz.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I've notice a behaviour of quickcheck that is unexpected to me. With<br>
this code:<br>
<br>
import Test.QuickCheck<br>
<br>
main = check myconfig<br>
((\v -> v == v) :: (Maybe Double,Maybe Double) -> Bool)<br>
<br>
myconfig = defaultConfig{configMaxTest=100000,<br>
configEvery = \n args -> show n ++ ":\n"<br>
++ unlines args}<br>
<br>
I am relying on the default Arbitrary instances to generate pairs of<br>
maybe doubles. But to my surprise, all of the pairs have these patterns:<br>
<br>
(Just _ Just _)<br>
(Nothing, Nothing)<br>
<br>
I never see patterns:<br>
<br>
(Just _, Nothing)<br>
(Nothing, Just _)<br>
<br>
Why is this the case?<br>
<br>
Thanks,<br>
<br>
Tim<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto: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></div><br><br clear="all"><br>-- <br>Ozgur Akgun<br>