7 lines
180 B
Text
7 lines
180 B
Text
insert :: a -> [a] -> [a]
|
|
insert x xs = x : xs
|
|
insert x (y:ys) = y : insert x ys
|
|
|
|
permutation :: [a] -> [a]
|
|
permutation [] = []
|
|
permutation (x:xs) = insert x $ permutation xs
|