> It also might be helpful to know that there is already a subset generator 
> available in this library 
> <https://github.com/gfredericks/test.chuck#generators>.
>

Thanks, this looks good, will check it out.
 

> What you've done here might appear to work, but it will get you into 
>> trouble when test.check starts to shrink your inputs. When test.check runs 
>> your generators it relies you you using it as your only source of 
>> randomness, and so your use of `rand-int` will cause some problems.
>>
>>
Ah yes, I didn't think of shrinking.
Thanks a lot for your help! :)
 
 

> The trick is to use the `bind` function to make a generator which depends 
>> on the value of another generator (in this case, to capture the generated 
>> map so you can call rand-subset with the correct set of keys):
>>
>

 I didn't get why I had to use a bind here. What if I had only used fmap?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to