In Swift, we can write extensions for common elements, such as a sequence:
extension Sequence where Iterator.Element : ObservableType { }
This ensures that the extension only extends to the sequences (in this case) of the observed RxSwift.
However, if an element restriction is another general, can you limit this general? eg:.
extension Sequence where Iterator.Element : ObservableType where E : MyType { }
In the above pseudo code (which does not work), the intention is to say:
This extension should apply to Observable sequences, where Observable is an observable of type MyType, for example. [Observed]
source share