-
Notifications
You must be signed in to change notification settings - Fork 13
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
Is it possible to support embedded structures? #72
Comments
Hello. I do apologize for the time it takes to answer. That's a good question. In python: >>> f"hello {[1,2]}"
'hello [1, 2]' In PyF, you can use the Prelude PyF> :set -XTemplateHaskell -XQuasiQuotes
Prelude PyF> [fmt|hello {[1,2]:s}|]
"hello [1,2]" However, making it to work without the
Prelude PyF> :set -XTypeFamilies
Prelude PyF> type instance PyFClassify [t] = 'PyFString
Prelude PyF> [fmt|hello {[1,2]}|]
"hello [1,2]" However, this has to be done for all instances. There is no support in Haskell for "overlappable" type instances, so we cannot write something such as |
I tried to add an
But it generates conflicts and now any I'll try to think about a solution, in the meantime, you can use the |
Hi @guibou , thank you for the detailed answer, it clarifies a few other questions I had (the one above was my work account)! |
As Python interpolation supports embedded expressions, I wonder if it's possible for PyF to support something like:
The text was updated successfully, but these errors were encountered: