purescript-quickcheck icon indicating copy to clipboard operation
purescript-quickcheck copied to clipboard

Shrinking

Open samhh opened this issue 5 years ago • 6 comments

New to QuickCheck on the whole, but I understand shrinking is a popular feature in other language implementations. Would be cool to see it here :slightly_smiling_face:

samhh avatar Feb 29 '20 22:02 samhh

There is a quickcheck style library with shrinking, although I'm not sure how up to date it is with the latest compiler and such: https://github.com/jacobstanley/purescript-jack

garyb avatar Feb 29 '20 23:02 garyb

No interest in updating this library? Or has the community consensus shifted towards Jack?

samhh avatar Mar 05 '20 12:03 samhh

I wouldn't say that there's no interest, but it is low priority for me personally.

hdgarrood avatar Mar 05 '20 12:03 hdgarrood

Would like to try this one. Would be happy to be aware before I put my hands on it if there is any significant tip in designing of the shrinking algorithm.

the-dr-lazy avatar Jul 21 '22 20:07 the-dr-lazy

You'll probably want to get a core team member to agree to review the PR you would create as that will likely be the biggest bottleneck after implementing the solution.

I'm not sure how complicated such a solution is, so I'm not sure whether I'm qualified to review it.

JordanMartinez avatar Jul 21 '22 22:07 JordanMartinez

I just involved myself with it. My understanding is that best design space currently is based on the Hedgehog approach which bring Gen a to become State GenState (Tree a). Although it is possible to have Monad instance over the definition, the behavior of the shrinker will be deceptively different from Applicative instance, which for me (and newcomers?), it means the default generator should not expose any monodic interface (Monad, MonadRec, MonadGen?! Why MonadGen should have monad instance BTW?). But as it sounds, it will be a huge breaking change to the whole current Gen API. Absolutely, there can be a shrinking mechanism like QuickCheck but I found writing custom shrinkers in daily manner completely pointless and impractical in nature.

the-dr-lazy avatar Jul 22 '22 17:07 the-dr-lazy