-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Applicative vs Monadic generators #473
Comments
I've also wondered this! I've also wondered if we would benefit from |
For shrinking, I don't see any advantage to use monadic behavior when applicative behavior is possible. |
Semi-related question - would this also reduce the space leaks that occur during shrinking? Whenever I run a test on my workstation which doesn't have a swap partition, I have to keep an eye on memory usage; whenever a failing test occurs, shrinking it often (maybe... 15% of the time?) quickly eats up all of my RAM and freezes, resulting in my workstation requiring a hard power reset. |
Maybe, but it certainly should not. That is definitely a bug. It would be great if you could find (and share) a small example that consistently reproduces that behavior. |
Unfortunately it seems to come and go; mainly with deep and wide recursive structures (think SAT/SMT formulas). It's also quite possibly unrelated to Hedgehog itself, and due to the nature of telemetry collection while shrinking x3 |
So, I've read that one should avoid monadic generators in general due to reducing the effectiveness of shrinking. Does this imply that using
anywhere I define a new generator is a good idea? (I'm okay with the longer compile time if it means better shrinking; but of course, one can always remove the optimal flag.)
If so, does this suggest using
ApplicativeDo
globally in Hedgehog is a good idea, given how much monadic manipulation ofTree
s occurs in the library?The text was updated successfully, but these errors were encountered: