diffit.map
diff
(diff am bm)
Returns a pair [edit-distance edit-script] as result of comparision
of two maps am and bm.
The edit-distance is the number of assocs+dissocs necessary to
reproduce bm from am.
The edit-script is a map with three entries:
:+ sequence of k-v pairs that are only present in bm
:- sequence of keys removed in bm
:r sequence of k-v pairs that have changed in bm.
The edit-script can be used with patch to create bm from am.
patch
(patch assoc-f dissoc-f replace-f am [d {adds :+, dels :-, reps :r}])
(patch am [d {adds :+, dels :-, reps :r}])
Takes a map am and the result as produced by diff and returns a map
with all deletions, replacements and additions applied to the input
map.