Skip to content

Instantly share code, notes, and snippets.

@bdesham
Created June 3, 2011 03:46
Show Gist options
  • Save bdesham/1005837 to your computer and use it in GitHub Desktop.
Save bdesham/1005837 to your computer and use it in GitHub Desktop.
A Clojure function like flatten, except that it pulls elements out of sets instead of sequences.
(defn flatten-sets
"Like flatten, but pulls elements out of sets instead of sequences."
[v]
(filter (complement set?)
(rest (tree-seq set? seq (set v)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment