1 patch for repository http://darcsden.com/jcpetruzza/hint: Wed Apr 4 14:59:33 CEST 2012 Bertram Felgenhauer * clean temporary files in runInterpreterT(withArgs) New patches: [clean temporary files in runInterpreterT(withArgs) Bertram Felgenhauer **20120404125933 Ignore-this: ff9abed505645f81131a57182d371861 ] hunk ./src/Hint/Context.hs 10 PhantomModule(..), ModuleText, addPhantomModule, removePhantomModule, getPhantomModules, + cleanPhantomModules, allModulesInContext, onAnEmptyContext, hunk ./src/Hint/Context.hs 254 -- onState (\s ->s{qual_imports = quals}) --- | All imported modules are cleared from the context, and --- loaded modules are unloaded. It is similar to a @:load@ in --- GHCi, but observe that not even the Prelude will be in --- context after a reset. -reset :: MonadInterpreter m => m () -reset = +-- | 'cleanPhantomModules' works like 'reset', but skips the +-- loading of the support module that installs '_show'. Its purpose +-- is to clean up all temporary files generated for phantom modules. +cleanPhantomModules :: MonadInterpreter m => m () +cleanPhantomModules = do -- Remove all modules from context runGhc2 Compat.setContext [] [] -- hunk ./src/Hint/Context.hs 280 import_qual_hack_mod = Nothing, qual_imports = []}) liftIO $ mapM_ (removeFile . pm_file) (old_active ++ old_zombie) - -- - -- Now, install a support module - installSupportModule + +-- | All imported modules are cleared from the context, and +-- loaded modules are unloaded. It is similar to a @:load@ in +-- GHCi, but observe that not even the Prelude will be in +-- context after a reset. +reset :: MonadInterpreter m => m () +reset = do -- clean up context + cleanPhantomModules + -- + -- Now, install a support module + installSupportModule -- Load a phantom module with all the symbols from the prelude we need installSupportModule :: MonadInterpreter m => m () hunk ./src/Hint/InterpreterT.hs 164 ifInterpreterNotRunning $ do s <- newInterpreterSession `catch` rethrowGhcException -- SH.protectHandlers $ execute s (initialize args >> action) - execute s (initialize args >> action) + execute s (initialize args >> action `finally` cleanSession) where rethrowGhcException = throw . GhcException . showGhcEx #if __GLASGOW_HASKELL__ < 610 newInterpreterSession = do s <- liftIO $ hunk ./src/Hint/InterpreterT.hs 170 Compat.newSession GHC.Paths.libdir newSessionData s + cleanSession = cleanPhantomModules -- clean ghc session, too? #else -- GHC >= 610 newInterpreterSession = newSessionData () hunk ./src/Hint/InterpreterT.hs 174 + cleanSession = + do cleanPhantomModules + runGhc $ do dflags <- GHC.getSessionDynFlags + GHC.defaultCleanupHandler dflags (return ()) #endif {-# NOINLINE uniqueToken #-} Context: [bump to version 0.3.3.4 jcpetruzza@gmail.com**20111220224039 Ignore-this: 23d55959cc61ebbd20f5ebd4f2a86bd9 ] [authors file updated jcpetruzza@gmail.com**20111220224018 Ignore-this: e4f66f8324ac599e74e665a1e2292c12 ] [compile with ghc 7.4 snapshot Mark Wright **20111220114907 Ignore-this: cc43ccb4e716324ccfbfbb1d38f2668c ] [TAG 0.3.3.3 jcpetruzza@gmail.com**20111104192050 Ignore-this: f2f8da08437fa759cb41f0f4e35a11a ] Patch bundle hash: 7ee3dacd0f2fd8713494534c000231ed2e85b783