nick8325 / quickcheck

Automatic testing of Haskell programs.
Other
713 stars 119 forks source link

Test.QuickCheck.Shrinking without Arbitrary #273

Open symbiont-sam-halliday opened 4 years ago

symbiont-sam-halliday commented 4 years ago

It would be very useful to be able to have stateful shrinkers, as per Test.QuickCheck.Shrinking without having to use the Arbitrary machinary.

e.g. something complementing forAllShrink (forAllShrinkState?) that can take a ShrinkState instance (or manually passing the two relevant functions).

Related to #272

MaximilianAlgehed commented 5 months ago

You can use forAllShrink with generators and shrinkers for something of type Shrink s a instead of a. That would let you bypass the Arbitrary machinery but it may not be super ergonomic. Is it correctly understood that you're looking for something that would effectively work like using forAllShrink @(Shrink s a) but with better ergonimics?