1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00
semantic/prototype/Doubt/Optional.swift

13 lines
277 B
Swift
Raw Normal View History

2015-10-02 23:48:44 +03:00
extension Optional {
static func equals(param: (Wrapped, Wrapped) -> Bool)(_ left: Wrapped?, _ right: Wrapped?) -> Bool {
switch (left, right) {
case let (.Some(a), .Some(b)):
return param(a, b)
case (.None, .None):
return true
default:
return false
}
}
}