[Haskell-cafe] ANN: LeanCheck v0.9.0 -- enumerative property testing

Rudy Matela rudy at matela.com.br
Thu Jan 17 02:10:29 UTC 2019

Hello Haskell Café,

A new version of LeanCheck is out (v0.9.0).  LeanCheck is a property
testing library (like QuickCheck) that tests values enumeratively.

_Example._  Here's a simple example of LeanCheck in action showing that
sorting is idempotent and list union is not commutative:

    > 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]

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 [LeanCheck's Haddock documentation] for more

_Whats new?_  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.  [LeanCheck's changelog]
provides more details.

A separate package [leancheck-instances] provides instances for other
types in the Haskell Platform.

_Installing._ You can find LeanCheck on [Hackage] or [GitHub].  It is also
tracked on [Stackage].  As usual, you can install it with:

        $ cabal install leancheck


[Hackage]: https://hackage.haskell.org/package/leancheck
[GitHub]: https://github.com/rudymatela/leancheck
[Stackage]: https://www.stackage.org/package/leancheck
[LeanCheck's changelog]: https://hackage.haskell.org/package/leancheck/changelog
[LeanCheck's Haddock documentation]: https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190116/93b8b23e/attachment.html>

More information about the Haskell-Cafe mailing list