   provided."
   ([f]
    (fn [rf]
-     (let [ia (atom -1)]
+     (let [ia (volatile! -1)]
        (fn
          ([] (rf))
          ([result] (rf result))
          ([result input]
-            (let [i (swap! ia inc)
+            (let [i (vswap! ia inc)
                   v (f i input)]
               (if (nil? v)
                 result

  Returns a stateful transducer when no collection is provided."
  ([n]
     (fn [rf]
       (let [na (atom n)]
         (fn
           ([] (rf))
           ([result] (rf result))
           ([result input]
              (let [n @na]
                (swap! na dec)
                (if (pos? n)
                  result
                  (rf result input))))))))

  ([f]
     (fn [rf]
       (let [a (array-list)
             pa (volatile! ::none)]
         (fn
           ([] (rf))
           ([result]
