Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- applyRefactorings :: FilePath -> Maybe (Int, Int) -> [[Refactoring SrcSpan]] -> FilePath -> [String] -> IO String
- applyRefactorings' :: Maybe (Int, Int) -> [[Refactoring SrcSpan]] -> Module -> IO String
- runRefactoring :: Data a => a -> Refactoring SrcSpan -> StateT Int IO a
- parseExtensions :: [String] -> ([Extension], [Extension], [String])
Documentation
:: FilePath | FilePath to GHC's libdir. It is possible to use |
-> Maybe (Int, Int) | Apply hints relevant to a specific position |
-> [[Refactoring SrcSpan]] |
The |
-> FilePath | Target file |
-> [String] | GHC extensions, e.g., These are in addition to the |
-> IO String |
Apply a set of refactorings as supplied by HLint
:: Maybe (Int, Int) | |
-> [[Refactoring SrcSpan]] | |
-> Module | ghc-exactprint AST annotations. This can be obtained from
|
-> IO String |
Like applyRefactorings
, but takes a parsed module rather than a file path to parse.
runRefactoring :: Data a => a -> Refactoring SrcSpan -> StateT Int IO a Source #
Peform a Refactoring
.
parseExtensions :: [String] -> ([Extension], [Extension], [String]) Source #
Parse the input into (enabled extensions, disabled extensions, invalid input).
Implied extensions are automatically added. For example, FunctionalDependencies
implies MultiParamTypeClasses
, and RebindableSyntax
implies NoImplicitPrelude
.
The input is processed from left to right. An extension (e.g., StarIsType
)
may be overridden later (e.g., by NoStarIsType
).
Extensions that appear earlier in the input will appear later in the output. Implied extensions appear in the end. If an extension occurs multiple times in the input, the last one is used.
>>>
parseExtensions ["GADTs", "RebindableSyntax", "StarIsType", "GADTs", "InvalidExtension", "NoStarIsType"]
([GADTs, RebindableSyntax, GADTSyntax, MonoLocalBinds], [StarIsType, ImplicitPrelude], ["InvalidExtension"])