A port of Eric Lippert's Combinations code to Swift