Created
May 5, 2011 15:01
-
-
Save noidi/957202 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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