Closed gafter closed 1 year ago
The function show
shouldn't be defined if the user has already done so.
You cannot specialize a function on a type that hasn't been declared yet.
The implementation of show
should correctly handle cyclic data structures in which Q
in on the cycle.
The current latest version (not registered yet) supports all this.
In many client scenarios, thee are types for which the generated code would be more efficient if it (1) computed the hash code at construction time and cached it, and (2) compares the hash codes when comparing for equality, to shortcut the potentially more expensive equality comparisons on the elements.
Specifically, code like this
would be translated to something like
(I'm willing to do the work of implementing this.)