All types should support the visitor pattern used by hash() #185
Labels
breaking-change
This is a tag for issues whose implementation needs a new major version
enhancement
New feature or request
needs-api-design
hash() uses a visitor pattern so users can customize how hashing should be performed and can even supply hashers that use heuristics.
We should extend this pattern to all traits. E.g.
eq()
should use a hasher should just use itself as the visitor but could take arbitrary others. This way we could implement a lot more complex comparisons; let users customize the function per type, even add heuristic equality comparison.Other features could use a simplified implementation; e.g. we could unify shallowclone and deepclone (deepclone is just a clone with itself as the visitor, shallowclone is just a clone with the identify function as visitor).
The text was updated successfully, but these errors were encountered: