Clojurians
#test-check
<
2016-09-05
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

lvh20:09:10

I have a seq of generators; I’d like a generator that concats the seqs; how do I do that while keeping shrinking?

lvh20:09:17

(IIUC sample would work, but would break shrinking.)

lucasbradstreet20:09:54

Can you just do (gen/fmap #(reduce into [] %) (apply gen/tuple seq-of-generators)

lvh20:09:41

(I also just realized that I can just make the generator later; i.e. first compute the concat’d thing, then chuck.gen/subsequence from that)

lucasbradstreet20:09:57

Yeah, that would also work

lvh20:09:54

thanks :slightly_smiling_face: that was stumping me until I wrote it out :slightly_smiling_face: