Skip to content

Instantly share code, notes, and snippets.

@dryman
Created May 10, 2012 03:27
Show Gist options
  • Save dryman/2650855 to your computer and use it in GitHub Desktop.
Save dryman/2650855 to your computer and use it in GitHub Desktop.
Power Set
(defn power-set [lst]
(if (seq lst)
(clojure.set/union
(apply hash-set (for [x (next lst)] #{(first lst) x}))
(power-set (next lst)))
#{#{}}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment