-
Notifications
You must be signed in to change notification settings - Fork 51
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
Generator for type with more than 2 properties #39
Comments
Zip is overloaded so you can combine up to three Gens, so your example can be written as.
So things currently start to get ugly at four. This needs to be extended to support more values but it needs to stop somewhere (6?), at which point the best solution is probably to fix the modelling of the type being generated. I'm open to suggestions of other ways the api could allow Gens to be combined. |
You might consider having a generator for "tuples" of various arities, such that you might then write:
This is approximately the same as your |
Also, consider the following code snippet:
It's super cool to be able to map a scalar onto a tuple-type like this. When you do this, however, IntelliJ helpfully highlights the lambda, saying "lambda can be replaced with a method reference". Unfortunately, because
Suggestion: how about having methods called |
Is there a cleaner syntax for creating a Gen for a type with more than 2 properties than what I have below? This starts to get ugly for types with more properties...
The text was updated successfully, but these errors were encountered: