Skip to content
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

Add interpolation to the quasiquoter? #166

Open
thomasjm opened this issue Feb 8, 2019 · 2 comments
Open

Add interpolation to the quasiquoter? #166

thomasjm opened this issue Feb 8, 2019 · 2 comments

Comments

@thomasjm
Copy link

thomasjm commented Feb 8, 2019

It would be really handy if you could interpolate values in the yamlQQ quasiquoter using #{...} notation, just like how aeson-qq provides this for JSON.

@snoyberg
Copy link
Owner

PR welcome, but I don't have any plans on adding that myself for now.

@sjshuck
Copy link

sjshuck commented Nov 8, 2020

Just thinking out loud. I guess the two biggest issues would be

  1. Parsing embedded Haskell in aeson-qq works via the haskell-src-meta package, which pulls in significant dependencies such as haskell-src-exts. Installing haskell-src-meta takes 3 extra minutes on my machine after installing yaml.
  2. aeson-qq has the nice property that # or $ are always invalid JSON in that context, and therefore function unambiguously. In YAML, there's isn't a reliable choice of characters that would violate the syntax: in particular, the # in an unquoted scalar introduces a comment, and the $ can just occur normally in a mapping key.

It seems like an external library would be better suited to implement this functionality.

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

No branches or pull requests

3 participants