   [promises]
   (let [xform (comp
                (map promise)
-               (map future))]
+               (map promise->future))]
     (->> (sequence xform promises)
          (into-array CompletableFuture)
          (CompletableFuture/anyOf)

  ([p] (deliver p nil))
  ([p v]
   {:pre [(promise? p)]}
   (let [f (future p)]
     (if (instance? Throwable v)
       (.completeExceptionally f v)
       (.complete f v)))))

  [p]
  (pending* p))

(defn promise->future
  "Converts a promise in a CompletableFuture instance."
  [^Promise p]
  (.-cf p))
