Created
December 10, 2018 12:17
-
-
Save nanoxd/ec458c20c401ce06eeda86a12c7ce74d to your computer and use it in GitHub Desktop.
[Collection.anySatisfy] With the introduction of allSatisfy, we can cleanly represent the inverse.
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 Collection { | |
func anySatisfy(_ p: (Element) -> Bool) -> Bool { | |
return !self.allSatisfy { !p($0) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment