haskell-tools-refactor-0.7.0.0: Refactoring Tool for Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Refactor.Session

Contents

Description

Common operations for managing refactoring sessions, for example loading packages, re-loading modules.

Synopsis

Documentation

loadPackagesFrom :: IsRefactSessionState st => (ModSummary -> IO a) -> ([ModSummary] -> IO ()) -> (st -> FilePath -> IO [FilePath]) -> [FilePath] -> StateT st Ghc (Either RefactorException ([a], [String])) Source #

Load packages from the given directories. Loads modules, performs the given callback action, warns for duplicate modules.

handleErrors :: ExceptionMonad m => m a -> m (Either RefactorException a) Source #

Handle GHC exceptions and RefactorException.

reloadChangedModules :: IsRefactSessionState st => (ModSummary -> IO a) -> ([ModSummary] -> IO ()) -> (ModSummary -> Bool) -> StateT st Ghc (Either RefactorException [a]) Source #

Reload the modules that have been changed (given by predicate). Pefrom the callback.

reloadModule :: IsRefactSessionState st => (ModSummary -> IO a) -> ModSummary -> StateT st Ghc a Source #

Reload a given module. Perform a callback.

codeGenForModule :: (ModSummary -> IO a) -> [ModuleCollection] -> ModSummary -> Ghc a Source #

Re-load the module with code generation enabled. Must be used when the module had already been loaded, but code generation were not enabled by then.

getEvaluatedMods :: [ModSummary] -> Ghc [ModSummary] Source #

Check which modules can be reached from the module, if it uses template haskell.

code copied from GHC because it is not public in GhcMake module