I want to do the following in Clojure as idiomatically as possible:
- transduce a collection
- associate each element of the input collection with the corresponding element in the output collection
- return the result in a hashmap
Is there a succinct way to do this using core library functions?
If not, what improvements can you suggest to the following implementation?
(defn to-hash [coll xform]
(reduce
merge
(map
#(apply hash-map %)
(mapcat hash-map coll (into [] xform coll)))))