Unnamed
public text v1 · immutableperms :: [a] -> [[a]]
perms [] = [[]]
perms (x:xs) = [take i perm ++ [x] ++ drop i perm
| perm <- perms xs, i <- [0..length perm]]
perms :: [a] -> [[a]]
perms [] = [[]]
perms (x:xs) = [take i perm ++ [x] ++ drop i perm
| perm <- perms xs, i <- [0..length perm]]