All types should support the visitor pattern used by hash() #185
Open
Description
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).