nick8325 / quickcheck

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

`Natural` data type: Moving instances from quickcheck-instances to QuickCheck #358

Closed asr closed 1 year ago

asr commented 1 year ago

Since Natural data type is defined in the base library, I suggest to move the instances of Arbitrary, CoArbitrary and Function for Natural from the quickcheck-instances library to QuickCheck. In this way, we shall avoid to install the additional dependencies of quickcheck-instances when using QuickCheck with this data type. The instances are defined here.

@nick8325 and @phadej, any opinion?

phadej commented 1 year ago

Natural is not in base for all versions of base QuickCheck compiles with.

Current solution avoids code duplication (first in QuickCheck and then in quickcheck-instances for the rest of supported base versions).

If QuickCheck's base lower bound is bumped to a version with Natural, then the instance can be moved.

asr commented 1 year ago

You are right. QuickCheck shouldn't remove the support for GHC < 7.10 (i.e. base 4.8.0.0) only because the missing instances for Natural were added. Thanks.