Update README

This commit is contained in:
Nick Smallbone 2018-02-23 12:54:48 +01:00
parent 0454c6d331
commit 8cad801bdc
2 changed files with 36 additions and 31 deletions

View File

@ -1,12 +1,11 @@
QuickSpec: equational laws for free!
====================================
Ever get that nagging feeling that your code must satisfy some equational laws,
but not sure what they are? Want to write some QuickCheck properties, but not
sure where to start? QuickSpec might be for you! QuickSpec takes any set of
Haskell functions and tries to discover laws about those functions.
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.
Give QuickSpec the functions `reverse`, `++` and `[]`, for example, and it will
For example, give QuickSpec the functions `reverse`, `++` and `[]`, and it will
find six laws:
```haskell
@ -18,9 +17,12 @@ reverse (reverse xs) == xs
reverse xs ++ reverse ys == reverse (ys ++ xs)
```
Despite these limitations, QuickSpec works well on many examples. The
best way to get started with it is to look at the `examples` directory,
for example `Arith.hs`,`ListMonad.hs`, or `Parsing.hs`. You can also
look at our paper,
http://www.cse.chalmers.se/\~nicsma/papers/quickspec2.pdf\[Quick
specifications for the busy programmer\].
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](http://hackage.haskell.org/package/quickspec/docs/QuickSpec.html).
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](http://www.cse.chalmers.se/~nicsma/papers/quickspec2.pdf).

View File

@ -15,39 +15,40 @@ Category: Testing
Synopsis: Equational laws for free!
Description:
QuickSpec automatically finds equational laws about your program.
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.
.
Give it an API, i.e. a collection of functions, and it will spit out
equations about those functions. For example, given @reverse@, @++@
and @[]@, QuickSpec finds six laws, which are exactly the ones you
might write by hand:
For example, give QuickSpec the functions @reverse@, @++@ and @[]@, and
it will find six laws:
.
> xs++[] == xs
> []++xs == xs
> (xs++ys)++zs == xs++(ys++zs)
> reverse [] == []
> xs ++ [] == xs
> [] ++ xs == xs
> reverse (reverse xs) == xs
> reverse xs++reverse ys == reverse (ys++xs)
> (xs ++ ys) ++ zs == xs ++ (ys ++ zs)
> reverse xs ++ reverse ys == reverse (ys ++ xs)
.
The laws that QuickSpec generates are not proved correct, but have
passed at least 1000 QuickCheck tests.
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 normal use, you will only need the main "QuickSpec" module.
.
For more information, see the @README@ file at
<https://github.com/nick8325/quickspec/blob/master/README.asciidoc>,
or look at the @examples@ directory.
For information on how to use QuickSpec, see the documentation in the main
module, "QuickSpec". 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,
<http://www.cse.chalmers.se/~nicsma/papers/quickspec2.pdf Quick specifications for the busy programmer>.
Extra-source-files:
README.asciidoc
README.md
examples/Arith.hs
examples/Bools.hs
examples/Combinators.hs
examples/Composition.hs
examples/Conditionals.hs
examples/Const.hs
examples/Geometry.hs
examples/HugeLists.hs
examples/IntSet.hs
examples/ListMonad.hs
examples/Lists.hs
examples/Octonions.hs
@ -56,6 +57,8 @@ Extra-source-files:
examples/PrettyPrintingModel.hs
examples/Process.hs
examples/Regex.hs
examples/Sorted.hs
examples/Zip.hs
source-repository head
type: git