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

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Refactor.Prepare

Description

Defines utility methods that prepare Haskell modules for refactoring

Synopsis

Documentation

tryRefactor :: (RealSrcSpan -> Refactoring IdDom) -> String -> String -> IO () Source #

A quick function to try the refactorings

correctRefactorSpan :: UnnamedModule dom -> RealSrcSpan -> RealSrcSpan Source #

Adjust the source range to be applied to the refactored module

useFlags :: [String] -> Ghc [String] Source #

Set the given flags for the GHC session

reloadPkgDb :: Ghc () Source #

Reloads the package database based on the session flags

initGhcFlags :: Ghc () Source #

Initialize GHC flags to default values that support refactoring

initGhcFlags' :: Bool -> Ghc () Source #

Sets up basic flags and settings for GHC

useDirs :: [FilePath] -> Ghc () Source #

Use the given source directories when searching for imported modules

deregisterDirs :: [FilePath] -> Ghc () Source #

Don't use the given source directories when searching for imported modules

toFileName :: FilePath -> String -> FilePath Source #

Translates module name and working directory into the name of the file where the given module should be defined

toBootFileName :: FilePath -> String -> FilePath Source #

Translates module name and working directory into the name of the file where the boot module should be defined

getSourceDir :: ModSummary -> IO FilePath Source #

Get the source directory where the module is located.

getModSumOrig :: ModSummary -> FilePath Source #

Gets the path to the source file of the module.

getModSumName :: ModSummary -> String Source #

Gets the module name

loadModule :: String -> String -> Ghc ModSummary Source #

Load the summary of a module given by the working directory and module name.

type TypedModule = Ann UModule IdDom SrcTemplateStage Source #

The final version of our AST, with type infromation added

parseTyped :: ModSummary -> Ghc TypedModule Source #

Get the typed representation from a type-correct program.

withAlteredDynFlags :: GhcMonad m => (DynFlags -> m DynFlags) -> m a -> m a Source #

Modifies the dynamic flags for performing a ghc task

forceCodeGen :: ModSummary -> ModSummary Source #

Forces the code generation for a given module

forceAsmGen :: ModSummary -> ModSummary Source #

Forces ASM code generation for a given module

modSumNormalizeFlags :: ModSummary -> ModSummary Source #

Normalizes the flags for a module summary

normalizeFlags :: DynFlags -> DynFlags Source #

Removes all flags that are unintelligable for refactoring

readSrcSpan :: String -> RealSrcSpan Source #

Read a source range from our textual format: line:col-line:col or line:col

readSrcLoc :: String -> RealSrcLoc Source #

Read a source location from our format: line:col