RosettaCodeData/Task/Combinations/Pure/combinations.pure
2023-07-01 13:44:08 -04:00

7 lines
144 B
Text

comb m n = comb m (0..n-1) with
comb 0 _ = [[]];
comb _ [] = [];
comb m (x:xs) = [x:xs | xs = comb (m-1) xs] + comb m xs;
end;
comb 3 5;