Skip to content

Instantly share code, notes, and snippets.

@vilmibm
Created June 13, 2013 20:31
Show Gist options
  • Save vilmibm/5777085 to your computer and use it in GitHub Desktop.
Save vilmibm/5777085 to your computer and use it in GitHub Desktop.
might need this
(defn list-to-map
"Given a list and a function that computes a key for a given list
item, return a map of key -> list item"
[key-fn lst]
(into {} (set (map (fn [item] [(key-fn item) item]) lst))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment