-
Notifications
You must be signed in to change notification settings - Fork 42
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
Interpret TemplateHaskell's Exp and TExp #85
Comments
There are many packages defining a type named |
it's related to template haskell ghc -XTemplateHaskell -ddump-splices https://github.com/ghc/ghc/blob/master/libraries/template-haskell/Language/Haskell/TH/Syntax.hs https://markkarpov.com/tutorial/th.html https://github.com/ghc/ghc/blob/master/libraries/ghci/GHCi/TH.hs |
I think you mean the No,
Finally, note that with |
i read the doc: https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/external-interpreter https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/typecheck/TcSplice.hs |
I must reiterate that the sensible task here is to interpret an AST, that is, a value of type Here's is my understanding of that wiki page. When ghc encounters a TH splice, it parses the splice's contents as an expression of type So That makes me realize that if we want to extend hint to interpret I will reopen the ticket in order to track that approach, but I won't have time to look into it for a while. So once again, I recommend manipulating the |
thanks so much, pretty-printing is fine for me. myFunc :: Q Exp
myFunc = do
x <- newName "x"
return $ LamE
[VarP x]
(InfixE (Just (VarE x)) (VarE '(+)) (Just (LitE (IntegerL 1))))
-- repl
putStrLn $(X.myFunc >>= stringE . pprint) |
i need to concat some code from web ui .
the pain text process is unsafe for me.
as i know, the ghc compiler can compile the Quasi monad to haskell code.
so i want to know, is it feasible to run Quasi mond using the library?
The text was updated successfully, but these errors were encountered: