We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
(If this is not the proper channel for questions, please close this and kindly point me to the right channel)
Say I want to generate some value v from a fixed set of random integers. E.g.
v
case class Person(age: Int) val personRng = f(Rng.int, Rng.int, Rng.int).map(i => Person(i)) val io = personRng.run io.unsafePerformIO // prints `Person(10)` io.unsafePerformIO // prints `Person(19)` io.unsafePerformIO // prints `Person(10)` io.unsafePerformIO // prints `Person(19)` io.unsafePerformIO // prints `Person(77)` io.unsafePerformIO // prints `Person(19)` io.unsafePerformIO // prints `Person(77)`
I don't care what the numbers are, but I care that they're always picked from a pool with a fixed size.
I tried the following, which did not produce what I expected:
val personRng = for { a <- Rng.int b <- Rng.int c <- Rng.int age <- Rng.oneof(a, b, c) } yield Person(age)
This seems like it should be easy to achieve, but I can't figure out how.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
(If this is not the proper channel for questions, please close this and kindly point me to the right channel)
Say I want to generate some value
v
from a fixed set of random integers. E.g.I don't care what the numbers are, but I care that they're always picked from a pool with a fixed size.
I tried the following, which did not produce what I expected:
This seems like it should be easy to achieve, but I can't figure out how.
Thanks in advance.
The text was updated successfully, but these errors were encountered: