Created
August 21, 2015 21:32
-
-
Save hyperspacemark/5d9bd429959f3f98b596 to your computer and use it in GitHub Desktop.
A new implementation of `flatMap(f:)` added to `SequenceType` in Swift 2.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension SequenceType { | |
/// Return an `Array` containing the non-nil results of mapping | |
/// `transform` over `self`. | |
/// | |
/// - Complexity: O(*M* + *N*), where *M* is the length of `self` | |
/// and *N* is the length of the result. | |
public func flatMap<T>(@noescape transform: (Self.Generator.Element) -> T?) -> [T] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment