-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Align Differentiable with Identifiable protocol #80
Comments
Thank you for your proposal @Marcocanc As you described, Identifiable and Differentiable have semantically the same properties. public extension Differentiable where Self: Identifiable {
@inlinable
var differenceIdentifier: ID {
id
}
} |
Thanks for the quick feedback. I understand that aligning the API might not be worth breaking existing code bases. I have created a separate PR (#83) which introduces |
Thanks @Marcocanc The changes by #83 breaks the existing API, but agrees that it can be further clarified by separating identification and equality, so I'll allow this and include it in the next version 1.2.0. Whether to change the naming |
Checklist
Description
Since the identity component of
Differentiable
is semantically identical to the newIdentifiable
protocol in Swift 5.1, I think it would be beneficial to align the two APIs.Motivation and Context
This allows us to easily conform to
Identifiable
as well asDifferentiable
through a single implementation.Proposed Solution
ContentEquatable
) and Identification (ContentIdentifiable
) component through the use of protocol composition forDifferentiable
ContentIdentifiable
to that ofIdentifiable
See #81 for implementation details
The text was updated successfully, but these errors were encountered: