|Version 1 (modified by 11 years ago) (diff),|
In GHC 6.4 and subsequently you can import GHC as a Haskell library. This lets you write a Haskell program that has access to all of GHC.
To do this you say simply
Doing this imports the module
GHC from the package
ghc, which comes with GHC 6.4 and subsequent. The module GHC exports the "GHC API", which is still in a state of flux. Currently it's not even Haddock-documented. You can see the source code (which is somewhat documented) here
Here's an example main program that does it.