purescript / purescript-quickcheck

An implementation of QuickCheck in PureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shrinking

samhh opened this issue Β· 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 πŸ™‚

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

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

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

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.

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.

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.