summaryrefslogtreecommitdiff
path: root/21-28/26.hs
blob: cbc469bdc1a516a677f8085e2e04faca73a8d5ba (plain) (blame)
1
2
3
4
5
combinations :: Int -> [a] -> [[a]]

combinations 0 _ = [[]]
combinations _ [] = []
combinations k (x:xs) = [x:t | t <- combinations (k - 1) xs] ++ combinations k xs