Last active
May 28, 2018 05:50
-
-
Save naohaq/c8fcabedb52f25006f543a045b819b5e to your computer and use it in GitHub Desktop.
Generate the list of all combinations.
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
comb_0_1 :: (Num a) => Int -> [[a]] | |
comb_0_1 n | n >= 0 = f [[]] n | |
| otherwise = [] | |
where f xs 0 = xs | |
f xs n = f [(b:x) | b<-[0,1], x<-xs] (n-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment