[Haskell-cafe] SmallCheck design question

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Fri Dec 11 11:36:20 EST 2009

>> 2. why depth and not size (= total number of constructors)?

> That seems harder to generate terms compositionally. To create all
> terms of depth n+1 you just glue together all terms of depth n, but to
> create terms of size n+1 you need to glue 1 with n, 2 with n-1 etc.


One would fear that this is inefficient
because then these series (of smaller sizes)
would have to be generated several times.

But no, instead of class Serial a where series :: Int -> [a]
one could "cache" these into  series' :: [[a]]
such that  series k == series' !! k

actually, series k == [ 0 .. k ] >>= ( series' !! )
because I'd want series' do be disjoint
(each object has only one size).

That should be doable by a simple rewrite of (some parts)
of the library. I'm going to find a clever student
to whom I could assign this ...

Are there any standard test cases
(i.e., they work nicely with the original Smallcheck
and must continue to work with any modified version)?

Best - Johannes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20091211/9ebbf9be/signature.bin

More information about the Haskell-Cafe mailing list