[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] SmallCheck design question

Subject: Re: [Haskell-cafe] SmallCheck design question
From: Johannes Waldmann
Date: Fri, 11 Dec 2009 17:36:20 +0100
>> 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.

So?

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.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe
<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Haskell-cafe] SmallCheck design question, Johannes Waldmann <=