apply-refact-0.14.0.0: Perform refactorings specified by the refact library.
Safe HaskellNone
LanguageHaskell2010

Refact.Internal

Synopsis

Documentation

apply :: Maybe (Int, Int) -> Bool -> [(String, [Refactoring SrcSpan])] -> Maybe FilePath -> Verbosity -> Module -> IO String #

Apply a set of refactorings as supplied by hlint

runRefactoring :: Data a => a -> Refactoring SrcSpan -> StateT Int IO a #

Peform a Refactoring.

parseExtensions :: [String] -> ([Extension], [Extension], [String]) #

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"])

Support for runPipe in the main process

data Verbosity #

Constructors

Silent 
Normal 
Loud 

Instances

Instances details
Show Verbosity # 
Instance details

Defined in Refact.Internal

Eq Verbosity # 
Instance details

Defined in Refact.Internal

Ord Verbosity # 
Instance details

Defined in Refact.Internal

onError :: String -> Errors -> a #