Skip to content

All types should support the visitor pattern used by hash() #185

Open
@koraa

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).

Metadata

Assignees

No one assigned

    Labels

    breaking-changeThis is a tag for issues whose implementation needs a new major versionenhancementNew feature or requestneeds-api-design

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions