Equational laws for free
Go to file
2023-12-14 10:48:07 +01:00
examples Syntax fix for type applications. 2023-09-21 18:42:35 +02:00
src Whoops, accidentally tested the old code 2023-12-14 10:48:07 +01:00
.gitignore Update .gitignore. 2019-08-22 17:54:40 +02:00
.hgtags Added tag 2.2 for changeset 27442ba21db9 2023-09-21 18:18:38 +02:00
.travis.yml remove gmp from travis file 2018-02-27 19:00:55 +01:00
changelog Bump version. 2023-09-21 18:18:25 +02:00
FUTURE.md todo 2018-02-27 22:47:41 +01:00
LICENSE snapshot 2018-02-23 12:00:36 +01:00
notes Tinker with stuff 2020-04-15 14:39:12 +02:00
quickspec.cabal Bump version. 2023-09-21 18:18:25 +02:00
README.md Update README 2018-02-23 12:54:48 +01:00
Setup.hs Initial Cabal file. 2012-06-15 12:48:42 +02:00
stack.yaml Bump stack resolver. 2023-03-12 19:15:39 +01:00

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.