compacted() replaces the common compactMap { $0 } pattern, product() eliminates ...
Paul Hudson @twostraws@mastodon.social
compacted() replaces the common compactMap { $0 } pattern, product() eliminates nested for-loops, and uniqued() removes duplicates from any sequence. Apple's Swift Algorithms package is full of small wins like these. https://www.hackingwithswift.com/articles/243/write-better-code-with-swift-algorithms