containers icon indicating copy to clipboard operation
containers copied to clipboard

Export code necessary to make Arbitrary instances

Open treeowl opened this issue 9 years ago • 5 comments

Arbitrary instances are defined as orphans in the tests. This is reasonable, because they're tuned to test the implementations, rather than for users. However, it might be nice to export some functions designed to allow fast Arbitrary instances in QuickCheck.

treeowl avatar Feb 22 '16 03:02 treeowl

All tests are compiled with TESTING macro, which exports constructors and several other methods, so I think the Arbitrary instances could be defined more efficiently -- it is just that no one did that :-)

Also, if you need more methods for testing, just add them to the conditionally exported list

foxik avatar Feb 22 '16 08:02 foxik

@foxik What I'm really talking about are functions to support quickcheck testing of code that uses containers. For sequences, that mostly means an efficient shrink (the one for lists is pretty ... arbitrary, so I think there's a good bit of wiggle room). For other containers, I'm not really sure.

treeowl avatar Feb 22 '16 08:02 treeowl

Oh, sorry, I did not get that. Reopening.

foxik avatar Feb 22 '16 08:02 foxik

Thanks.

treeowl avatar Feb 22 '16 08:02 treeowl

I wonder whether it would be better to discuss the Arbitrary instances on the QuickCheck issue tracker.

Here, the issue doesn't seem to get a lot of attention.

sjakobi avatar Jul 15 '20 02:07 sjakobi