-
Notifications
You must be signed in to change notification settings - Fork 105
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
no Gen.let or heterogeneous sequence/tuple? #276
Comments
Ah, I found |
Also, |
|
Does that mean I have to define classes to hold them or is there a way to actually produce a Tuple directly from Gen.compose? |
Nope, it's polymorphic in the return type of the builder closure. All you've gotta do is provide a block that acts as a stencil for your tuple let generator = Gen.compose { (builder) -> (Int, Float, Array<Int>) in
return (builder.generate(), builder.generate(), builder.generate())
} |
Awesome. Thanks! |
Given that I think you've got your answer, I'm going to close this out. Please feel free to reopen it if I'm wrong about that part. |
i.e.,
https://github.com/clojure/test.check/blob/master/src/main/clojure/clojure/test/check/generators.cljc#L1585-L1588
and
https://github.com/clojure/test.check/blob/master/src/main/clojure/clojure/test/check/generators.cljc#L82-L87
Any workarounds approaching these other than nesting
flatMap
s (which would become rather unwieldy)?The text was updated successfully, but these errors were encountered: