Created
September 16, 2016 17:00
-
-
Save anmonteiro/1dea0b30ebcc195875dc5d0b102f69c8 to your computer and use it in GitHub Desktop.
custom-merge-sends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn custom-merge-sends [a b] | |
(let [a (cond->> a | |
(not (every? (set (keys a)) (keys b))) | |
(merge (zipmap (keys b) (repeat []))))] | |
(merge-with #(into %1 (mapcat identity) %2) a b))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment