Avatar
swift-nightlyとswift-tensorflow復活。 @swift-main enum Result<Value, Error> { case success(Value) case failure(Error) } extension Result: Equatable where Value: Equatable, Error: Equatable { static func == (lhs: Result, rhs: Result) -> Bool { switch (lhs, rhs) { case let (.success(lhs), .success(rhs)): return lhs == rhs case let (.failure(lhs), .failure(rhs)): return lhs == rhs case (.success, .failure), (.failure, .success): return false } } } print(Result<String, Never>.success("a") == Result<String, Never>.success("b"))
swift 1