-
Notifications
You must be signed in to change notification settings - Fork 32
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
Specifying concrete types for makeRep0Inline doesn't work #83
Comments
This is indeed a bug. Currently, Is this bug fixable? In some cases, perhaps. It would be annoying to make it work in the general case, however. Consider this example: newtype S (a :: k) = MkS k (Proxy a)
instance Generic (S Bool) where
type Rep (S Bool) = $(makeRep0Inline ''S [t| S Bool |])
... Currently, |
What if we specify kinds explicitly? E.g. type Rep (S Bool) = $(makeRep0Inline ''S [t| S (Bool :: Type) |]) |
It would still be rather fragile. The reason that When you're allowed to instantiate type variables, however, things become trickier. Consider Again, I don't think this would be impossible to do, but it require a great deal of care to make sure the implementation is right. |
I've made a small project illustrating the issue: https://github.com/lierdakil/generic-deriving-issue
Given some types
I'm trying to make an instance:
This, however, fails with a pretty confusing error message:
-ddump-splices
is indeed useful here:You might notice, the splice is referencing a type variable
a_i2J2
, which is not on the left-hand side of the type instance definition (because I've used a concrete type,OtherData
as an argument).The expectation that this should work. But it doesn't, likely due to a bug or an oversight. Maybe I'm misunderstanding something. If so, please explain.
Cheers!
The text was updated successfully, but these errors were encountered: