Skip to content

Instantly share code, notes, and snippets.

@david-bergstrom
Last active August 29, 2015 14:10
Show Gist options
  • Save david-bergstrom/41372dee908dff4eaaaa to your computer and use it in GitHub Desktop.
Save david-bergstrom/41372dee908dff4eaaaa to your computer and use it in GitHub Desktop.
An implementation of a superset algorithm, give it a list of elements and it will give you all the possible subsets of it.
superset [] = [[]]
superset (x:xs) = rest ++ [x : l | l <- rest]
where rest = superset xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment