<div dir="auto"><div dir="auto">Awesome. I always wondered what the pros/cons are compared to random testing like Quick check. When should I reach to enumerative testing?</div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 17, 2019, 03:11 Rudy Matela <<a href="mailto:rudy@matela.com.br">rudy@matela.com.br</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Hello Haskell Café,</p>
<p>A new version of LeanCheck is out (v0.9.0). LeanCheck is a property
testing library (like QuickCheck) that tests values enumeratively.</p>
<p><em>Example.</em> Here’s a simple example of LeanCheck in action showing that
sorting is idempotent and list union is not commutative:</p>
<pre><code>> import Test.LeanCheck
> import Data.List (sort, union)
> check $ \xs -> sort (sort xs) == sort (xs::[Int])
+++ OK, passed 200 tests.
> check $ \xs ys -> xs `union` ys == ys `union` (xs::[Int])
*** Failed! Falsifiable (after 4 tests):
[] [0,0]
</code></pre>
<p>LeanCheck works on all types that are instances of the Listable typeclass
and is able to derive instances automatically using either Template
Haskell or GHC.Generics. See <a href="https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html" target="_blank" rel="noreferrer">LeanCheck’s Haddock documentation</a> for more
details.</p>
<p><em>Whats new?</em> Version 0.9.0 marks the addition of Listable typeclass
instances for most standard Haskell types defined in the Haskell 2010
Language Report. This means you’ll be able to test more functions without
needing to define Listable instances yourself. <a href="https://hackage.haskell.org/package/leancheck/changelog" target="_blank" rel="noreferrer">LeanCheck’s changelog</a>
provides more details.</p>
<p>A separate package [leancheck-instances] provides instances for other
types in the Haskell Platform.</p>
<p><em>Installing.</em> You can find LeanCheck on <a href="https://hackage.haskell.org/package/leancheck" target="_blank" rel="noreferrer">Hackage</a> or <a href="https://github.com/rudymatela/leancheck" target="_blank" rel="noreferrer">GitHub</a>. It is also
tracked on <a href="https://www.stackage.org/package/leancheck" target="_blank" rel="noreferrer">Stackage</a>. As usual, you can install it with:</p>
<pre><code> $ cabal install leancheck
</code></pre>
<p>–
Rudy</p>
_______________________________________________<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 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>