     }
     
     public static var allElements: [Self] {
-        (0 ..< n.intValue).permutations.map{
+        (0 ..< n.intValue).permutations().map{
             .init(length: n.intValue, indices: $0)
         }
     }
     
     public static var allTranspositions: [Self] {
-        (0 ..< n.intValue).choose(2).map { .transposition($0[0], $0[1]) }
+        (0 ..< n.intValue).combinations(ofCount: 2).map {
+            .transposition($0[0], $0[1])
+        }
     }
     
     public static var countElements: Int {

//  Created by Taketo Sano on 2018/03/12.
//  Copyright © 2018年 Taketo Sano. All rights reserved.
//

public struct Permutation<n: SizeType>: Multiplicative, MathSet, Hashable {
    public let length: Int


extension Permutation where n == anySize {
    public static func allPermutations(length n: Int) -> [Self] {
        (0 ..< n).permutations().map{
            .init(length: n, indices: $0)
        }
    }
    
    public static func allTranspositions(within n: Int) -> [Self] {
        (0 ..< n).combinations(ofCount: 2).map {
            .transposition(length: n, indices: ($0[0], $0[1]))
        }
    }
}

