nick8325 / quickcheck

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

Negative & NonPositive #245

Closed BebeSparkelSparkel closed 5 years ago

BebeSparkelSparkel commented 5 years ago

Trying to keep from obfuscating my code by negating Positive.

phadej commented 5 years ago

We'd need NonPositive for completeness too.

BebeSparkelSparkel commented 5 years ago

@phadej I'm having problems building this. When I cabal configure it errors with cabal: failed to parse output of 'ghc-pkg dump'. What command should I use to build this?

Lysxia commented 5 years ago

cabal new-build should be the only thing to build.

BebeSparkelSparkel commented 5 years ago

@Lysxia Thanks. I needed to reinstall cabal

nick8325 commented 5 years ago

Thanks! In the end I rewrote the patch to generate negative numbers directly, because negating the output of Positive wouldn't ever generate minBound for twos-complement integers.

BebeSparkelSparkel commented 5 years ago

I didn't even think of that. Appreciate your help getting that right

nick8325 commented 5 years ago

I think that Positive had a similar bug in the past, which is why I spotted it :)