smallcheck icon indicating copy to clipboard operation
smallcheck copied to clipboard

Extract Number Wrappers

Open BebeSparkelSparkel opened this issue 4 years ago • 1 comments

There is a lot of overlap with number newtypes like Negative, Positive with QuickCheck. It would be nice to share those types between the various testing packages.

Would you consider allowing an external package for these types?

BebeSparkelSparkel avatar Jan 28 '20 13:01 BebeSparkelSparkel

Yeah, I think I'd be open to that. My two concerns are:

  1. Ensuring that this new package itself is lightweight — i.e. it doesn't add any other transitive dependencies to smallcheck.
  2. Ensuring that the new package doesn't break/bitrot (transitively breaking smallcheck with it). If you add me or someone else with a track record of quickly fixing broken packages to the list of backup maintainers of hackage, that would be enough.

UnkindPartition avatar Jan 28 '20 18:01 UnkindPartition

Closing, since https://github.com/nick8325/quickcheck/issues/286 did not see much traction.

I suggest exporting types from smallcheck and defining orphan instance Arbitrary, see https://github.com/Bodigrim/arithmoi/blob/master/test-suite/Math/NumberTheory/TestUtils/Wrappers.hs#L56 and below.

Bodigrim avatar Aug 19 '22 20:08 Bodigrim