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
Promoted classes without Proxy #171
Promoted classes without Proxy #171
Conversation
e8a79b9
to
60e1f9e
Compare
Just to make it clear, this version does not remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fantastic. Thanks so much. Do check out my comment in promoteType
, though, as I think there's a flat-out error there.
go [] (DVarT name) = return $ DVarT name | ||
go _ (DVarT name) = fail $ "Cannot promote an applied type variable " ++ | ||
show name ++ "." | ||
go args (DSigT ty ki) = DSigT <$> go args ty <*> go [] ki |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong. It will treat (x :: k) y
as (x y :: k)
, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I didn't entirely understand what I was doing here. I'll add a test.
@@ -228,3 +228,6 @@ singDecsM :: DsMonad q => [Dec] -> SgM [DDec] -> q [DDec] | |||
singDecsM locals thing = do | |||
(decs1, decs2) <- singM locals thing | |||
return $ decs1 ++ decs2 | |||
|
|||
proxyFor :: DType -> DExp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one use of this function will be able to removed once goldfirere/th-desugar#47 is merged, I think. I don't love the one-off use of the Proxy
names here, but it should be temporary enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I intended this function to be temporary, which is why it's in an inappropriate module and uses Proxy
names this way. Looking forward to getting rid of it.
cfc9dba
to
b5e4091
Compare
b5e4091
to
48e1ee8
Compare
Yay! Thanks! |
closes #149
In the light of https://ghc.haskell.org/trac/ghc/ticket/12928, I decided to proceed as follows:
*
. This is OK because beforeTypeInType
we were limited byKProxy
anyway.This way, we always get CUSKs where we need them.
I also modified
promoteType
slightly, so this PR closes #145, because now this code compiles: