-
Notifications
You must be signed in to change notification settings - Fork 42
Type name confusion #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This goes beyond my Haskell-fu, I'm afraid. If you believe you have a fix for this issue, feel free to add a test for this case and do the appropriate change, making sure all the tests pass. /cc @Simspace |
I assume you meant to cc me, not my employer :) I am familiar with that bug, I had to work around it in hawk. The fix would be to always quantify the type with its module name. That doesn't look too hard:
|
I'm so sorry - misread the github UI. |
Hmm! This is more difficult than I though. Qualifying the type with its module name was easy, but that only helps if the type synonym resolves to a type from a module which is imported under its fully-qualified name. @ryanreich's So, if Since it is generating the name of the type which is tricky, I thought I could work around the problem by generating I really don't know how, though. One possible clue: I noticed that on hackage, when looking at the documentation for |
The interpreter's type checker produces a clearly wrong error when the interpreted expression evaluates to a type synonym whose definition contains a qualified-imported type constructor whose native name is the same as the synonym. See simple.zip for a minimal example (stack project).
Looking at the source, it seems to me that the problem is in the code
because Typeable's string representation doesn't give the fully qualified name of the type constructors.
Renaming the type synonym actually doesn't help, for the same reason: the compiler then complains that it can't find the imported type constructor. You have to simply avoid using a type synonym altogether, since Typeable (of course) doesn't print the name of the synonym but its expansion.
The text was updated successfully, but these errors were encountered: