Changes between Version 10 and Version 11 of Commentary/Compiler/API


Ignore:
Timestamp:
Sep 15, 2006 11:08:38 PM (9 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/API

    v10 v11  
    1919 * Perform [[ref(Dependency Analysis)]]: {{{depanal}}}
    2020 * Load (compile) the source files: {{{load}}}
     21
     22Here is some boilerplate that seems to initialize GHC and a session.  Basically taken from ghc's Main.
     23
     24{{{
     25import DynFlags
     26import GHC
     27
     28mode = Interactive
     29
     30main = defaultErrorHandler defaultDynFlags $ do
     31  GHC.init (Just "/usr/local/lib/ghc-6.5")  -- or your build tree!
     32  s <- newSession mode
     33  flags <- getSessionDynFlags s
     34  (flags, _) <- parseDynamicFlags flags []
     35  GHC.defaultCleanupHandler flags $ do
     36    flags <- initPackages flags
     37    setSessionDynFlags s flags
     38}}}
    2139
    2240== Targets ==