public typealias LazyCompactMapCollection<Elements, ElementOfResult> : some Collection<.Element == ElementOfResult> = LazyMapSequence< LazyFilterSequence< LazyMapSequence<Elements, ElementOfResult?> >, ElementOfResult > extension LazyMapCollection { public func compactMap<U>(_ transform: @escaping (Element) -> U?) -> LazyCompactMapCollection<Base, U> { // ... } public func filter(_ isIncluded: @escaping (Element) -> Bool) -> LazyCompactMapCollection<Base, Element> { // ... } }