I have problems with a programming problem here. Half of the problem is that the problem itself is rather complicated, and the other half is that I donβt remember how to find my way around QuickCheck.
I know that if you write a function that takes several arguments with an instance Arbitrary, QuickCheck will let you use this method as a test. I cannot figure out how to create new test arguments inside this method. I want to write something like
prop13 :: Foo -> Bar -> Bool
prop13 foo bar =
if foobar foo bar
then fn1 foo
else newInput $ \ baz -> fn2 foo bar baz
but I can't figure out how the hell to do it.
In fact, no, I really want to write
prop13 :: Foo -> Bar -> Property
prop13 foo bar =
if foobar foo bar
then label "foobar=YES" $ fn1 foo
else label "foobar=NO" $ newInput $ \ baz -> fn2 foo bar baz
so that I can verify that it does not accept one branch at 100% of the time or something ridiculous.
, , , baz - . QuickCheck, - , . ( , ...)
? "", , , ...