[Haskell-cafe] Libraries of standard QuickCheck properties
leather at cs.uu.nl
Thu Aug 21 17:19:50 EDT 2008
This in response to a comment on a GHC ticket . I thought it was
interesting enough to warrant general discussion.
Comment (by JeremyShaw):
> > Also, where does the H98 report say all instances of Eq must be
> transitive, reflexive, symmetric, and antisymmetric? It just says "The Eq
> class provides equality (==)..", whatever that might mean :-)
> Well, it does not say it explicitly, but I suspect H98's usage of Eq
> implicitly demands those laws be followed.
Indeed. The same goes for the implicit law that (x /= y) /= (x == y), since
both (/=) and (==) can be overridden. 
Hopefully in Haskell' the laws
> will not only be stated, but there will be some QuickCheck-style
> properties you can use to test your own instances ;)
This is an interesting thought. Has there been any work towards collecting
properties written with QuickCheck (or similar) into a reusable chunk of
some form? It would be very convenient to have parametrized properties that
tested implicit laws such as equality, monads, and other things that come
with the Haskell Platform. Not only would such a library be useful to use,
but it would provide a number of readily available examples for would-be
testers, thus encouraging testing.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe