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

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

  [p]
  (pending* p))

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