-
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
Discard on failed pattern matches within a Generator #257
base: master
Are you sure you want to change the base?
Conversation
abd765b
to
4121279
Compare
A similar issue exists for |
See this conversation regarding |
I've spent some time thinking about this and the problem I have with it is that ideally one should aim to write tests / generators that don't ever discard. Discarding slows things down and I would consider its use a bit of an anti-pattern. I think it should only really be used as a last resort. You're better of using the just :: MonadGen m => m (Maybe a) -> m a
filter :: MonadGen m => (a -> Bool) -> m a -> m a So I'm just a bit unsure about making it syntactically convenient to discard, as often there are more appropriate options. I actually wonder if it would be better to remove the |
This aligns pretty well with @sol's comment on the same topic (QC): nick8325/quickcheck#228 (comment) If we decide to get rid of |
Too late 😅 I think this topic has too many trade-offs to rush the decision, so I'm not that concerned. What we ended up releasing is the same as what it has always been. |
4139585
to
c228279
Compare
As discussed in #233.