Avatar
I would like to propose the following change to the standard library: deprecate `Sequence.flatMap<U>(_: (Element) -> U?) -> [U]` and make this functionality available under a new name `Sequence.filteredMap(_:)`.
5:59 AM
Optional版のflatMapをfilteredMapに改名しようってメール来てる
6:04 AM
struct Person { var age: Int var name: String } func getAges(people: [Person]) -> [Int] { return people.flatMap { $0.age } }
6:04 AM
mapと間違えてflatMap使いつつ Optionalアップキャストして動いちゃう話