Skip to content

Instantly share code, notes, and snippets.

@drankard
Last active August 29, 2015 14:26
Show Gist options
  • Save drankard/fad9adb57c0399fbe7bf to your computer and use it in GitHub Desktop.
Save drankard/fad9adb57c0399fbe7bf to your computer and use it in GitHub Desktop.
(defn update-in-dataset
"Takes a dataset and apply the func on the value of the given keys"
[dataset keys func]
(let [t (fn [k m] (reduce #(assoc %1 %2 (func (%2 %1))) m k))]
(map #(t keys %) dataset)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment