Skip to content

Instantly share code, notes, and snippets.

@anmonteiro
Created September 16, 2016 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anmonteiro/1dea0b30ebcc195875dc5d0b102f69c8 to your computer and use it in GitHub Desktop.
Save anmonteiro/1dea0b30ebcc195875dc5d0b102f69c8 to your computer and use it in GitHub Desktop.
custom-merge-sends
(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