import List
comb :: Int -> [a] -> [[a]]
comb 0 _ = [[]]
comb _ [] = []
comb (n+1) (x:xs) = [x:ys | ys <-comb n xs] ++ comb (n+1) xs
comb :: Int -> [a] -> [[a]]
comb 0 _ = [[]]
comb _ [] = []
comb (n+1) (x:xs) = [x:ys | ys <-comb n xs] ++ comb (n+1) xs
No hay comentarios:
Publicar un comentario