QuickCheck support in libraries

I'd like libraries to provide QuickCheck support (instances of Arbitrary) for types they define, where possible. Are there any reasons not to routinely do so? Otherwise, I end up working them out for myself and probably replicating other people's work. - Conal

On Fri, 2007-10-26 at 23:13 -0700, Conal Elliott wrote:
I'd like libraries to provide QuickCheck support (instances of Arbitrary) for types they define, where possible. Are there any reasons not to routinely do so? Otherwise, I end up working them out for myself and probably replicating other people's work.
People sometimes worry about making their packages depend on the QuickCheck package. For example QuickCheck is not required to build ghc, but if we included the Arbitrary instances for ByteString in the bytestring package then ghc would depend on QuickCheck. Perhaps one solution is to use configurations, so people can build a package with or without the QuickCheck dependency. Duncan

On Sat, Oct 27, 2007 at 11:15:19AM +0000, Duncan Coutts wrote:
For example QuickCheck is not required to build ghc, but if we included the Arbitrary instances for ByteString in the bytestring package then ghc would depend on QuickCheck.
Perhaps one solution is to use configurations, so people can build a package with or without the QuickCheck dependency.
What would a dependency on bytestring 0.9 mean then? How would I indicate that I need the Arbitrary instance? Someone could make a ghc-bootlib-arbitrary package, containing all the Arbitrary instances for types in the bootlibs. Thanks Ian

On Sat, 2007-10-27 at 13:08 +0100, Ian Lynagh wrote:
On Sat, Oct 27, 2007 at 11:15:19AM +0000, Duncan Coutts wrote:
For example QuickCheck is not required to build ghc, but if we included the Arbitrary instances for ByteString in the bytestring package then ghc would depend on QuickCheck.
Perhaps one solution is to use configurations, so people can build a package with or without the QuickCheck dependency.
What would a dependency on bytestring 0.9 mean then? How would I indicate that I need the Arbitrary instance?
You're right, you couldn't.
Someone could make a ghc-bootlib-arbitrary package, containing all the Arbitrary instances for types in the bootlibs.
Yes, or the QuikCheck package might be a good place for most of those :-) The same problem goes for all libs, people are reluctant to add dependencies on QC and HUnit packages just for their tests. Perhaps the solution is that people should just not worry about adding such dependencies. Duncan

Hello Duncan, Saturday, October 27, 2007, 4:43:44 PM, you wrote:
The same problem goes for all libs, people are reluctant to add dependencies on QC and HUnit packages just for their tests. Perhaps the solution is that people should just not worry about adding such dependencies.
these libs looks like a very candidates to include in standard set -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

That's my leaning as well -- just make the dependency.
Alternatively, a library like foo could be accompanied by a library foo-QC.
On 10/27/07, Duncan Coutts
[...] The same problem goes for all libs, people are reluctant to add dependencies on QC and HUnit packages just for their tests. Perhaps the solution is that people should just not worry about adding such dependencies.
participants (5)
-
Bulat Ziganshin
-
Conal Elliott
-
Duncan Coutts
-
Ian Lynagh
-
Sebastian Sylvan