My own "buildwrapper" package (available from github and hackage) uses both haskell-src-exts and the GHC API to provide the same kind of services to the EclipseFP IDE plugins. You may be able to use it directly for your purpose or at least have a look at the code to get a feel for how to use the GHC API. Hope this helps JP On Thu, Dec 15, 2011 at 11:07 AM, Niklas Broberg <niklas.broberg@gmail.com> wrote:
Currently: Your only option is to use GHC API if you want type checking. I can't help you with that, sorry.
Envisioned: The function you ask for can definitely be written for haskell-src-exts, which I know you are currently using. I just need to complete my type checker for haskell-src-exts first. Which is not a small task, but one that has been started. I doubt it will be done in time for your project though, sorry.
Best regards,
/Niklas
On Tue, Dec 13, 2011 at 6:16 PM, Sh NJP <shayan.njp@gmail.com> wrote:
Hi,
I do some pre-processing on a normal Haskell code ( -F ). The pre-processor needs to know the type of each expression. What are the possibilities to do so? Can I use GHC API to employ GHC type checker? If yes, any good tutorial? Is it too naive to think of a function, f :: String -> AnnotatedAST , that takes Haskell code and returns its corresponding abstract syntax tree annotated with types?
Thanks, /shayan
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- JP Moresmau http://jpmoresmau.blogspot.com/