The expression
({:a 1} {:a 2})
evaluates to nil
. Maps in Clojure are functions which takes a key and returns the corresponding value. The expression
(let [f {:a 1}]
(f {:a 2}))
which is equivalent to ({:a 1} {:a 2})
tries to lookup the key {:a 2}
in the map {:a 1}
and since there is no such key in the map nil
is returned.
Going back to your original problem, all you have to do is to change the list ({:a 1} {:a 2})
to a vector [{:a 1} {:a 2}]
and it will work as expected. Note also that you don't need partial
in this particular case, (apply merge-with + [{:a 1} {:a 3}])
will work just fine.