nick8325 / quickcheck

Automatic testing of Haskell programs.
Other
722 stars 120 forks source link

`CoArbitrary` instance for Data.Void. #269

Closed leftaroundabout closed 5 years ago

leftaroundabout commented 5 years ago

The vacuous type Void contains no values. It can thus not have an Arbitrary instance, but it does offer a (trivial) CoArbitrary. While this is not really useful per se, it can be used to "disable" some parametric field of an alternative type.

phadej commented 5 years ago

https://hackage.haskell.org/package/quickcheck-instances-0.3.22/docs/Test-QuickCheck-Instances-Void.html

Void is not in QuickCheck as its not in all base supported by QuickCheck

(i.e. without CPP this patch will fail CI).

leftaroundabout commented 5 years ago

Ah. I thought such a simple instance would surely be defined right there in the default package and was just forgotten because it's normally useless, but if it's in the instance package, fine.

phadej commented 5 years ago

For the reference see also https://github.com/nick8325/quickcheck/issues/257