A library to allow merging of clojure maps using per-key merge policies.
Clojure Shell
Permalink
Failed to load latest commit information.
src/pallet
test/pallet
.gitignore
.travis.yml
README.md
ReleaseNotes.md
finish-release.sh
profiles.clj
project.clj
start-release.sh

README.md

pallet-map-merge

A library to allow merging of clojure maps using per-key merge policies.

Usage

By default, merge-keys does a deep merge:

(merge-keys {} {:a {:c 2}} {:a {:b 1}})
  => {:a {:b 1 :c 2}}

You can override this by specifying a merge policy on a per key basis.

(merge-keys {:a :union} {:a #{1}} {:a #{2}})
  => {:a #{1 2}}
(merge-keys
 {:a :concat :b :union}
 {:a [1] :b #{1}}
 {:a [2] :b #{2}})
  => {:a [1 2] :b #{1 2}}

API docs

Installation

To use pallet-map-merge, add the following to your :dependencies in project.clj:

[pallet-map-merge "0.1.1"]

Build Status

License

Copyright © 2012 Hugo Duncan

Distributed under the Eclipse Public License.