Equational laws for free
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples Reduce max test size for list monad Aug 15, 2018
src Always have 'a' in the universe Aug 21, 2018
.gitignore
.travis.yml remove gmp from travis file Feb 27, 2018
FUTURE.md todo Feb 27, 2018
LICENSE snapshot Feb 23, 2018
README.md Update README Feb 23, 2018
Setup.hs
changelog Add changelog Mar 28, 2018
notes
quickspec.cabal Bump version. May 16, 2018
stack.yaml

README.md

QuickSpec: equational laws for free!

QuickSpec takes your Haskell code and, as if by magic, discovers laws about it. You give QuickSpec a collection of Haskell functions; QuickSpec tests your functions with QuickCheck and prints out laws which seem to hold.

For example, give QuickSpec the functions reverse, ++ and [], and it will find six laws:

reverse [] == []
xs ++ [] == xs
[] ++ xs == xs
reverse (reverse xs) == xs
(xs ++ ys) ++ zs == xs ++ (ys ++ zs)
reverse xs ++ reverse ys == reverse (ys ++ xs)

QuickSpec can find equational laws as well as conditional equations. All you need to supply are the functions to test, as well as Ord and Arbitrary instances for QuickSpec to use in testing; the rest is automatic.

For information on how to use QuickSpec, see the documentation. You can also look in the examples directory, for example at List.hs, IntSet.hs, or Parsing.hs. To read about how QuickSpec works, see our paper, Quick specifications for the busy programmer.