Luke Evans | 8 Oct 01:21 2013

Using Quick Check generators for getting arbitrary value streams

I was hoping I could use Arbitrary instances to generate streams of values for test data.
It looks like you're not 'supposed' to be trying this, other than for the specific purpose of then testing
some properties on these streams within Quick Check itself.

I'm looking for something like the sample' function in Quick Check, only to produce an infinite stream of
values (rather than the 11 values that are clearly designed simply to give you a sense of the output of a generator).
Am I out of luck, or is there yet some cunning way of doing this without hacking the Quick Check package to
export the MkGen constructor?

-- Luke
adam vogt | 9 Oct 04:14 2013
Picon

Re: Using Quick Check generators for getting arbitrary value streams

Hi Luke,

It seems like you missed this module:
http://hackage.haskell.org/package/QuickCheck-2.6/docs/Test-QuickCheck-Gen.html

Adam

On Mon, Oct 7, 2013 at 7:21 PM, Luke Evans <luke <at> eversosoft.com> wrote:
> I was hoping I could use Arbitrary instances to generate streams of values for test data.
> It looks like you're not 'supposed' to be trying this, other than for the specific purpose of then testing
some properties on these streams within Quick Check itself.
>
> I'm looking for something like the sample' function in Quick Check, only to produce an infinite stream of
values (rather than the 11 values that are clearly designed simply to give you a sense of the output of a generator).
> Am I out of luck, or is there yet some cunning way of doing this without hacking the Quick Check package to
export the MkGen constructor?
>
> -- Luke
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
Anton Nikishaev | 10 Oct 21:12 2013
Picon

Re: Using Quick Check generators for getting arbitrary value streams

Luke Evans <luke <at> eversosoft.com> writes:

> I was hoping I could use Arbitrary instances to generate streams of
> values for test data.  It looks like you're not 'supposed' to be
> trying this, other than for the specific purpose of then testing some
> properties on these streams within Quick Check itself.
>
> I'm looking for something like the sample' function in Quick Check,
> only to produce an infinite stream of values (rather than the 11
> values that are clearly designed simply to give you a sense of the
> output of a generator).
> Am I out of luck, or is there yet some cunning way of doing this
> without hacking the Quick Check package to export the MkGen
> constructor?

You can make a generator that itself produces infinite list. There's
ready-made function in Test.QuickCheck.Instances.List for that (package
checkes)

--

-- 
lelf

Gmane