Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define valid equality/hashCode on Schema #17

Closed
jdegoes opened this issue Mar 2, 2021 · 0 comments
Closed

Define valid equality/hashCode on Schema #17

jdegoes opened this issue Mar 2, 2021 · 0 comments

Comments

@jdegoes
Copy link
Member

jdegoes commented Mar 2, 2021

Schema must have well-defined equality and hashCode methods.

Note that due to the presence of Schema#transform, which stores functions in the ADT, we will have to use reference equality on functions to check for equality and to compute hash code. Reference equality implies equality, but is not necessary for equality, which means that two schemas could in fact be equal, but equals will return false. That's a known and acceptable limitation of this approach.

We should have a test suite that demonstrates equal schemas compare as equal and hash the same.

thinkharderdev added a commit to thinkharderdev/zio-schema that referenced this issue Mar 5, 2021
@jdegoes jdegoes closed this as completed in 3b8c4d8 Mar 5, 2021
landlockedsurfer pushed a commit to landlockedsurfer/zio-schema that referenced this issue May 28, 2022
Co-authored-by: thinkharder <thinkharderdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant