     
     /// Return an `Array` containing tuples satisfies `predicate` with each elements of two `sources`.
     @warn_unused_result
-    func merge<S : SequenceType>(with: S, @noescape predicate: (Self.Generator.Element, S.Generator.Element) throws -> Bool) rethrows -> [(Self.Generator.Element, S.Generator.Element)] {
-        var result: [(Self.Generator.Element, S.Generator.Element)] = []
+    func merge<S : SequenceType>(with: S, @noescape predicate: (Generator.Element, S.Generator.Element) throws -> Bool) rethrows -> [(Generator.Element, S.Generator.Element)] {
+        var result: [(Generator.Element, S.Generator.Element)] = []
         for lhs in self {
             for rhs in with where try predicate(lhs, rhs) {
                 result.append((lhs, rhs))


public extension RangeReplaceableCollectionType {
    
    mutating func replace<C : CollectionType where Self.Generator.Element == C.Generator.Element>(with newElements: C) {
        self.replaceRange(self.indices, with: newElements)
    }
}

    /// - Complexity: O(`elements.count`).
    ///
    @warn_unused_result
    public func minElement<R : Comparable>(@noescape by: (Generator.Element) throws -> R) rethrows -> Generator.Element? {
        return try self.minElement { try by($0) < by($1) }
    }
    /// Returns the maximum element in `self` or `nil` if the sequence is empty.
