
10 Feb
2011
10 Feb
'11
5:09 a.m.
Hello, Is there a way to get access to the STG syntax tree of a program using the GHC api? i.e. a function that returns something of type `StgExpr' that can be used in a way similar to this: example module = defaultErrorHandler defaultDynFlags $ do runGhc (Just libdir) $ do dflags <- getSessionDynFlags setSessionDynFlags dflags target <- guessTarget targetFile Nothing setTargets [target] load LoadAllTargets modSum <- getModSummary $ mkModuleName module p <- parseModule modSum t <- typecheckModule p d <- desugarModule t c <- return $ coreModule d s <- coreToStg c return s Thanks for any help, Chris