# Parallel combinatorics

As part of an algorithm, I was meant to generate the whole set of all *k* − *c**o**m**b**i**n**a**t**i**o**n**s* efficiently. This may seem a really simple task but it is actually a little bit tricky, specially if one wants to handle large *n*/*k* values. The are out-of-the-box solutions which “do the job” but actually don’t work at all for not so big numbers.

Naive solutions can be implemented at once. For instance, the following would compute all *c**o**m**b*(20, 5) combinations (please, consider to grab a coffee…) :

```
import Control.Monad
replicateM 5 [1..20]
```