Skip to content

Replace haskell-src-exts with ghc-lib-parser - #39

Draft
mzabani wants to merge 6 commits into
masterfrom
ghc-lib-parser
Draft

Replace haskell-src-exts with ghc-lib-parser#39
mzabani wants to merge 6 commits into
masterfrom
ghc-lib-parser

Conversation

@mzabani

@mzabani mzabani commented Jul 29, 2026

Copy link
Copy Markdown
Owner

This should fix #36, but there's lots of learning and self-reviewing before I can merge this. See issue for more explanations.

@brandonchinn178 brandonchinn178 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace haskell-src-exts

2 participants