Last active
August 29, 2023 09:26
-
-
Save Dimanaux/fc635a2033a0a0a9ea49ab2fb8622702 to your computer and use it in GitHub Desktop.
Generating all subsets of a set (list) on Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Subsets | |
( | |
subsets | |
) where | |
subsets :: [a] -> [[a]] | |
subsets [] = [[]] | |
subsets (x:xs) = subsets xs ++ map (x:) (subsets xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment