<div dir="ltr">I think they're complaining about the name of the extension. Years ago, it was a separate extension, but it got folded into ScopedTypeVariables.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 17, 2019 at 8:01 PM Rudy Matela <<a href="mailto:rudy@matela.com.br">rudy@matela.com.br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p>On Thu, Jan 17, 2019 at 06:28:32PM +0100, Johannes Waldmann wrote:</p>
<blockquote><p>Prelude Test.LeanCheck> checkFor 1000 $ \ x y z -> isInfinite x ||
isInfinite y || isInfinite z || (x::Double) + (y+z) == (x+y)+z
*** Failed! Falsifiable (after 306 tests):
1.0 1.0 0.3333333333333333</p>
<p>Turns out the enumeration in Leancheck uses Rationals,
while Smallcheck uses encodeFloat, which happens to
produce only “nice” numbers (very few bits set) in the beginning.</p></blockquote>
<p>I improved the LeanCheck floating enumeration starting with v0.8.0 to
catch exactly this kind of error. :-)</p>
<blockquote><p>PS: this post wouldn’t be complete without me complaining
that I cannot (easily) put the type annotation
where it belongs - in the declaration of the name:</p>
<p>Prelude Test.LeanCheck> check $ \ (x::Double) y z -> x + (y+z) == (x+y)+z</p>
<p><u></u>:22:12: error:
Illegal type signature: ‘Double’
Type signatures are only allowed in patterns with ScopedTypeVariables</p>
<p>Wat? TypeVariables? There aren’t any!</p></blockquote>
<p>You can get the above to parse by passing <code>-XScopedTypeVariables</code> to GHC:</p>
<pre><code>$ ghci -XScopedTypeVariables
> import Test.LeanCheck
> check $ \(x::Double) y z -> x + (y+z) == (x+y) + z
*** Failed! Falsifiable (after 87 tests):
0.0 Infinity (-Infinity)
</code></pre>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>