Last active
December 26, 2015 19:59
-
-
Save redswallow/7205408 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
combinations [] = [[]] | |
combinations (x:xs) = map (x:) (combs xs) ++ combs xs |
This file contains hidden or 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
Haskell code snippets |
This file contains hidden or 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
remove x list= [n|n<-list,n/=x] | |
permutations [] = [[]] | |
permutations xs = [x:ps | x <- xs, ps <- permutations (remove x xs)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment