Skip to content

Instantly share code, notes, and snippets.

@noidi
Created May 5, 2011 15:01
Show Gist options
  • Save noidi/957202 to your computer and use it in GitHub Desktop.
Save noidi/957202 to your computer and use it in GitHub Desktop.
(use '[clojure.contrib.map-utils
:only [deep-merge-with]])
(defn file-path [[first & rest]]
(if rest
{first (file-path rest)}
first))
(defn restore-hierarchy [x]
(->> x
(map file-path)
(apply deep-merge-with list)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment