Derive two type classes with same unqualified name #17892
bishabosha
started this conversation in
Feature Requests
Replies: 0 comments 3 replies
-
That was intended exactly the way it is. We do not want name mangling here, so we fall back on the type alias trick. If this should be changed (which I would be skeptical about), it should be a feature request. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Related: #11175 |
Beta Was this translation helpful? Give feedback.
0 replies
-
what about using underscores for the prefix? (less likely to collide but still possible) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It is unfortunate that the path of a type class is not taken into consideration when creating cached fields for derived type class instances, leading to name collisions when two type classes share the same name, but have a different prefix.
Minimized code
Output
Expectation
the two derivation clauses refer to separate qualified types, they should be able to both be derived.
The following is a workaround - define a type alias and wrapper object to forward the
deriving
hook:Beta Was this translation helpful? Give feedback.
All reactions