Avatar
protocol Sequence { associatedtype Filtered func filter( _ isIncluded: (Iterator.Element) throws -> Bool ) rethrows -> Filtered } extension RangeReplaceableCollection { func filter(_ isIncluded: (Iterator.Element) throws -> Bool) rethrows -> Self { var result = Self() for element in self { if try isIncluded(element) { result.append(element) } } return result } }
6:04 AM
Lazy じゃなかった?
6:04 AM
swift-evolution - This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.