cy [[9 gen/int] [1 (gen/return nil)]]))
(gen/sample mostly-ints)
;; =&gt; (0 -1 nil 0 -2 0 6 -6 8 7)
</code></pre>
<h2><a href="#even-positive-integers" name="even-positive-integers"></a>Even, positive integers</h2>
<pre><code class="clojure">(def even-and-positive (gen/fmap #(* 2 %) gen/pos-int))
(gen/sample even-and-positive 20)
;; =&gt; (0 0 2 0 8 6 4 12 4 18 10 0 8 2 16 16 6 4 10 4)
</code></pre>
<h2><a href="#powers-of-two" name="powers-of-two"></a>Powers of two</h2>
<pre><code class="clojure">;; gener