function | removed v1.9.183 | added v1.9.14 | Edit |
(coll-gen pred init-coll)
returns a function of no args that returns a generator of collections of items conforming to pred, with the same shape as init-coll
(defn coll-gen
[pred init-coll]
(let [init (empty init-coll)]
(fn []
(gen/fmap
#(if (vector? init) % (into init %))
(gen/vector (gen pred))))))