Unfortunately, permutations5 has an error: > *Main> permutations5 [1..3] > [[1,2,3],[2,1,3],[3,2,1],[3,3,1],[3,2,2],[3,3,2]] > *Main> permutations6 [1..3] > [[1,2,3],[2,1,3],[3,2,1],[2,3,1],[3,1,2],[1,3,2]]