-
Notifications
You must be signed in to change notification settings - Fork 407
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
Improve arbitrary function generation #136
Comments
CoArbitrary, as in Haskell, is not possible given the |
I tried to implement CoArbitrary pocketberserker/scalacheck@4293d29 and replace arbitrary function implementation pocketberserker/scalacheck@169d1e4 . |
As a side note, it would be really nice if the generated functions could have a nice I took a stab at a version that uses reflection, and one of the advantages of this approach is that it is possible to generate functions like so:
But I think reflection is an inferior approach to Just something to keep in mind. Is anyone working on this right now? Is there an estimate? |
Hello, is there any plan to improve function generation for Scalacheck, either along the lines of @pocketberserker's work, or another way? |
pocketberserker's codes still does not work correctly due to mutable random number generator( Maybe there are 2 ways
|
work in progress |
I created a branch to update Scalacheck to use an immutable RNG, and created a basic Cogen type there. I was able to hack together a Gen[A => B] which produces deterministic, but non-constant, functions: The warts around using Option are still there -- I may try something a bit more radical. @rickynils, is this direction something you'd like to see in a PR? |
This has been discussed for some time. The current way of generating functions are quite stupid, since it will only generate constant functions.
#66 does some changes in this area, but it must be updated to current master. And maybe we should take the Haskell QuickCheck route instead, using some fashion of CoArbitrary.
The text was updated successfully, but these errors were encountered: