Implement support for custom shrinkers #25
Seelengrab
started this conversation in
Design & Ideas
Replies: 1 comment
-
Idea: Require |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, all shrinking is done naively & directly on the choice sequence (see here). This is neither customizable, nor anywhere close to optimal (and not at all how Hypothesis proper does it).
The plan for this is the following:
Possibility
basis, preferrably automatically tracking whichPossibility
we're currently inPossibility
basisMy current idea is to follow what Hypothesis does about half way, informing how the regions are tracked. A custom shrinker would be given access to the part of the choice sequence it's responsible for, having it return a newly modified choice sequence as a replacement. It may be necessary to rework the interface surrounding
Possibility
a bit to do so - e.g. proptest returns aValueTree
when producing elements, similar to what PropCheck/Hedgehog do (except smarter when it comes to laziness of shrunk values).Beta Was this translation helpful? Give feedback.
All reactions