-
Notifications
You must be signed in to change notification settings - Fork 69
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
Typelevel Cats based module added #921
Conversation
refactor union for hash
revert previous
plus update struct hash
modules/cats/src/smithy4s/interopcats/instances/ShowInstances.scala
Outdated
Show resolved
Hide resolved
@Baccata
Based upon our discussions above it should be different because its wrapped in a case class In addition should Enumeration use the case class/object formula or the hash of the underlying values , perhaps string value combined with int value |
In this case the wrapping in a case class is an implementation detail, as opposed to something that's reflected in the metamodel. When you wrap a piece of data in a structure at the smithy level however, the hashcode driven by the schema (which reflects that smithy-level information) ought to take the wrapping into consideration.
Good question. For enumeration, I think we should use either the hashcode of the Int value if the enum has the |
A module that provides a Schema Visitor for the Show and Hash typeclasses from Typelevel Cats
Implementation as follows
The general direction for Hash, is to provide a hashcode for data based off its its data model vs a smithy4s implementation detail.
This leads to data wrappers that are not reflective of the model , to be excluded from the hash implementation
*Wherever hashes are combined , this is done using the strategies outlined in MurmurHash3