-
Notifications
You must be signed in to change notification settings - Fork 108
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
Use TH quotes more to eliminate some CPP #394
base: master
Are you sure you want to change the base?
Conversation
f9bd127
to
21a1a1a
Compare
What do you think about this @parsonsmatt ? If you are a fan of this direction, I can try to also get rid of the CPP caused by |
I'll investigate these failures soon |
src/Database/Esqueleto/Record.hs
Outdated
-- `where` clause. | ||
[] | ||
] | ||
[d| sqlSelectColCount _ = sqlSelectColCount (Proxy @($(pure joinedTypes))) |] |
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.
Huh - there are two mentions of sqlSelectColCount
. This is one. Is it posible that the [d| ... |]
here is doing newName
instead of using the name in scope?
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.
I think you are right. This is quite odd behaviour (but also the type of issues I was hoping to find with this PR). I'll make a GHC ticket.
Strangely as welll
[d| $(varP 'foo) = ...|]
is fine but as soon as I try to add arguments, it fails to parse, so I moved those into a lambda
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 eliminates some CPP by switching to using TH quotes.
Before submitting your PR, check that you've:
stylish-haskell
and otherwise adhered to the style guide.After submitting your PR: