Repository: ReactiveX/RxSwift
File: RxSwift/Observables/Observable+Multiple.swift (Swift)

Code before:
    /**
    Transforms an observable sequence of observable sequences into an observable sequence
    producing values only from the most recent observable sequence.
    
    Each time a new inner observable sequence is received, unsubscribe from the
    previous inner observable sequence.

    - seealso: [switch operator on reactivex.io](http://reactivex.io/documentation/operators/switch.html)

    - returns: The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
    */
    public func switchLatest() -> Observable<E.E> {
        return Switch(source: asObservable())
    }
}

// MARK: concat

extension ObservableType {

    /**
    Concatenates the second observable sequence to `self` upon successful termination of `self`.

    - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html)
    
    - parameter second: Second observable sequence.
    - returns: An observable sequence that contains the elements of `self`, followed by those of the second sequence.
    */
    public func concat<O: ObservableConvertibleType>(_ second: O) -> Observable<E> where O.E == E {
        return Observable.concat([self.asObservable(), second.asObservable()])
    }
}

extension Observable {
    /**
     Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.

     This operator has tail recursive optimizations that will prevent stack overflow.

     Optimizations will be performed in cases equivalent to following:

     [1, [2, [3, .....].concat()].concat].concat()

     - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html)

     - returns: An observable sequence that contains the elements of each given sequence, in sequential order.
     */
    public static func concat<S: Sequence >(_ sequence: S) -> Observable<Element>
        where S.Iterator.Element == Observable<Element> {
            return Concat(sources: sequence, count: nil)
    }

Review comment (suggestion):
I think we'll need to improve this. I'll try to check out can we reuse some of the texts from `http://reactivex.io/documentation/operators/defaultifempty.html`. 

Maybe something like:
```
Returns the elements of the specified sequence or `switchTo` sequence if the sequence is empty.
```

It's `parameter switchTo` now. 
Maybe `Observable sequence being returned when source sequence is empty.`

Maybe `- returns: Observable sequence that contains elements from switchTo sequence if source is empty, otherwise returns source sequence elements.`



Code after:
    /**
    Transforms an observable sequence of observable sequences into an observable sequence
    producing values only from the most recent observable sequence.
    
    Each time a new inner observable sequence is received, unsubscribe from the
    previous inner observable sequence.

    - seealso: [switch operator on reactivex.io](http://reactivex.io/documentation/operators/switch.html)

    - returns: The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
    */
    public func switchLatest() -> Observable<E.E> {
        return Switch(source: asObservable())
    }
}

// switchIfEmpty

extension ObservableType {
    /**
     Switches to other sequence if source is empty
     
     - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html)
     - parameter other: Other sequence which it switches to if the source is empty
     - returns: Switched observable sequence if source searqence is empty, otherwise emits element from the source sequence.
     */
    public func ifEmpty<S: ObservableType>(switchTo other: S) -> Observable<E> where E == S.E {
        return SwitchIfEmpty(source: asObservable(), other: other.asObservable())
    }
}

// MARK: concat

extension ObservableType {

    /**
    Concatenates the second observable sequence to `self` upon successful termination of `self`.

    - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html)
    
    - parameter second: Second observable sequence.
    - returns: An observable sequence that contains the elements of `self`, followed by those of the second sequence.
    */
    public func concat<O: ObservableConvertibleType>(_ second: O) -> Observable<E> where O.E == E {
        return Observable.concat([self.asObservable(), second.asObservable()])
    }
}

extension Observable {
    /**
     Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.