Created
May 1, 2015 05:19
-
-
Save tristaaan/ccf818d0cf8aa077e516 to your computer and use it in GitHub Desktop.
This file contains 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 Array{ | |
func every(fn: (T)->Bool) -> Bool{ | |
var out = true | |
for i in self { | |
out = out && fn(i); | |
} | |
return out | |
} | |
func some(fn: (T) -> Bool) -> Bool{ | |
var out = false | |
for i in self { | |
out = out || fn(i); | |
} | |
return out | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment