-
Notifications
You must be signed in to change notification settings - Fork 187
fromSetA follow up changes #1165
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
base: master
Are you sure you want to change the base?
Conversation
dbf6ed1 to
bff17cf
Compare
|
Both |
|
I would appreciate guidance on what to look for for data structure invariant tests. I moved those arbitrary instances to a separate module because, at least for the Set one, the instance was needlessly duplicated across modules and had increased complexity for no reason. If there was some shared containers-testing lib, then this module could be compiled once for all testing executables, but that is not the case currently. I would've moved the Map ones as well but of course the strict and lazy variants would have to have the odd cpp-based substitution, and that was complexity I wanted to avoid. |
|
Understood. The function you're looking for is called |
treeowl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally okay with this. Do you intend to reorganize the other Arbitrary instances in a follow-up?
|
I can if wanted but I don't think it would be the cleanest solution. Since this was triggered by @meooow25's request, I ask that they approve as well before merging. |
meooow25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to remove the Bot instances, improve the tests, and use liftA3.
But I also don't think the other Arbitrary changes belong here.
IMO there is no benefit in touching those instances at all. That little bit of duplication is harmless.
Finally getting to some of the changes requested by @meooow25 on #1163
In this PR we remove some unused instances, and try and share the implementations for some other instances. We also do some cleanup for some of the testing code. We use
liftA3instead of manually combining three actions (which uses liftA2 in the default implementation), and we also verify that the result offromSetAis correct in the case of the action ordering property test.