Skip to content

Instantly share code, notes, and snippets.

@matoous
Created June 6, 2018 06:01
Show Gist options
  • Save matoous/0908ed7a26a954caf6515770114ac0e0 to your computer and use it in GitHub Desktop.
Save matoous/0908ed7a26a954caf6515770114ac0e0 to your computer and use it in GitHub Desktop.
powerset :: [a] -> [[a]]
powerset [] = [[]]
powerset (a:b) = map (a:) p ++ p
where p = powerset b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment