Clojurians
# test-check

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

lvh 23:08:10

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

lvh 23:08:17

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

lucasbradstreet 23:09:54

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

lvh 23:10: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)

lucasbradstreet 23:10:57

Yeah, that would also work

lvh 23:11:54

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

lvh 23:12:34

exactly