Safe Haskell | None |
---|---|
Language | Haskell2010 |
Defines common utilities for using refactorings. Provides an interface for both demo, command line and integrated tools.
- useDirs :: [FilePath] -> Ghc ()
- useFlags :: [String] -> Ghc [String]
- initGhcFlags :: Ghc ()
- toFileName :: String -> String -> FilePath
- toBootFileName :: String -> String -> FilePath
- loadModule :: String -> String -> Ghc ModSummary
- type TypedModule = Ann Module IdDom SrcTemplateStage
- parseTyped :: ModSummary -> Ghc TypedModule
- performCommand :: (HasModuleInfo dom, DomGenerateExports dom, OrganizeImportsDomain dom, DomainRenameDefinition dom, ExtractBindingDomain dom, GenerateSignatureDomain dom) => RefactorCommand -> ModuleDom dom -> [ModuleDom dom] -> Ghc (Either String [RefactorChange dom])
- data RefactorCommand
- readCommand :: String -> String -> RefactorCommand
- analyzeCommand :: String -> String -> [String] -> RefactorCommand
- readSrcSpan :: String -> String -> RealSrcSpan
- readSrcLoc :: String -> String -> RealSrcLoc
- data IsBoot
- tryRefactor :: Refactoring IdDom -> String -> IO ()
Documentation
initGhcFlags :: Ghc () Source #
Initialize GHC flags to default values that support refactoring
toFileName :: String -> String -> FilePath Source #
Translates module name and working directory into the name of the file where the given module should be defined
toBootFileName :: String -> String -> FilePath Source #
Translates module name and working directory into the name of the file where the boot module should be defined
loadModule :: String -> String -> Ghc ModSummary Source #
Load the summary of a module given by the working directory and module name.
type TypedModule = Ann Module 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.
:: (HasModuleInfo dom, DomGenerateExports dom, OrganizeImportsDomain dom, DomainRenameDefinition dom, ExtractBindingDomain dom, GenerateSignatureDomain dom) | |
=> RefactorCommand | |
-> ModuleDom dom | The module in which the refactoring is performed |
-> [ModuleDom dom] | Other modules |
-> Ghc (Either String [RefactorChange dom]) |
Executes a given command on the selected module and given other modules
data RefactorCommand Source #
A refactoring command
readCommand :: String -> String -> RefactorCommand Source #
analyzeCommand :: String -> String -> [String] -> RefactorCommand Source #
readSrcSpan :: String -> String -> RealSrcSpan Source #
readSrcLoc :: String -> String -> RealSrcLoc Source #
tryRefactor :: Refactoring IdDom -> String -> IO () Source #