Created
December 28, 2019 05:47
-
-
Save fetfrum/9ef802240fa2d8c2f4fe224f533cbe6f to your computer and use it in GitHub Desktop.
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
perms :: [a] -> [[a]] | |
perms [] = [[]] | |
perms xs = [ y:zs | (y,ys) <- select xs, zs <- perms ys] | |
where select [] = [] | |
select (x:xs) = (x,xs) : [ (y,x:ys) | (y,ys) <- select xs ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment