Last active
August 29, 2015 14:26
-
-
Save harlanhaskins/8ac341494a7c674c10c1 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
protocol KindaEquatable { | |
func ~==(lhs: Self, rhs: Self) -> Bool | |
} | |
infix operator ~!= { associativity left precedence 140 } | |
func ~!=<T where T: KindaEquatable>(lhs: T, rhs: T) -> Bool { | |
return !(lhs ~== rhs) | |
} | |
// MARK: - String | |
extension String: KindaEquatable {} | |
infix operator ~== { associativity left precedence 140 } | |
func ~==(lhs: String, rhs: String) -> Bool { | |
return lhs.lowercaseString == rhs.lowercaseString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment