Replace haskell-src-exts with ghc-lib-parser - #39
Draft
mzabani wants to merge 6 commits into
Draft
Conversation
brandonchinn178
left a comment
There was a problem hiding this comment.
Cursory skim looks fine to me; AI is usually pretty good at mechanical transformations like convertExpr
Comment on lines
+55
to
+70
| [ OverloadedStrings, | ||
| OverloadedRecordDot, | ||
| TupleSections, | ||
| LambdaCase, | ||
| MultiWayIf, | ||
| PostfixOperators, | ||
| QuasiQuotes, | ||
| UnicodeSyntax, | ||
| MagicHash, | ||
| ForeignFunctionInterface, | ||
| TemplateHaskell, | ||
| RankNTypes, | ||
| MultiParamTypeClasses, | ||
| RecursiveDo, | ||
| TypeApplications | ||
| ] |
There was a problem hiding this comment.
You might be able to get the currently active extensions in the QuasiQuoter with extsEnabled and pass them through to here
| convertExpr (HsProjection _ flds) = | ||
| Right (TH.ProjectionE (fmap (\(L _ (DotFieldOcc _ (L _ fld))) -> fieldLabelToString fld) flds)) | ||
| #endif | ||
| convertExpr _ = Left "Unsupported Haskell expression form in hpgsql's SQL quasi-quoter" |
There was a problem hiding this comment.
Nit: I'd recommend explicitly enumerating instead of wildcard so that when new expressions are added, you'll get alerted to it and decide if you want to support it or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should fix #36, but there's lots of learning and self-reviewing before I can merge this. See issue for more explanations.