RosettaCodeData/Task/Combinations/Haskell/combinations-1.hs

5 lines
122 B
Haskell
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
comb :: Int -> [a] -> [[a]]
comb 0 _ = [[]]
comb _ [] = []
comb m (x:xs) = map (x:) (comb (m-1) xs) ++ comb m xs