Safe Haskell | None |
---|---|
Language | Haskell98 |
- data RefactSettings = RefSet {
- rsetVerboseLevel :: !VerboseLevel
- rsetEnabledTargets :: (Bool, Bool, Bool, Bool)
- data VerboseLevel
- defaultSettings :: RefactSettings
- type SimpPos = (Int, Int)
- data Options :: * = Options {
- optOutput :: OutputOpts
- optPrograms :: Programs
- optGhcUserOptions :: [GHCOption]
- optFileMappings :: [(FilePath, Maybe FilePath)]
- optEncoding :: String
- defaultOptions :: Options
- ifToCase :: RefactSettings -> Options -> FilePath -> SimpPos -> SimpPos -> IO [FilePath]
- compIfToCase :: FilePath -> SimpPos -> SimpPos -> RefactGhc [ApplyRefacResult]
- duplicateDef :: RefactSettings -> Options -> FilePath -> String -> SimpPos -> IO [FilePath]
- compDuplicateDef :: FilePath -> String -> SimpPos -> RefactGhc [ApplyRefacResult]
- liftToTopLevel :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath]
- compLiftToTopLevel :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult]
- liftOneLevel :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath]
- compLiftOneLevel :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult]
- demote :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath]
- compDemote :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult]
- rename :: RefactSettings -> Options -> FilePath -> String -> SimpPos -> IO [FilePath]
- compRename :: FilePath -> String -> SimpPos -> RefactGhc [ApplyRefacResult]
- addOneParameter :: RefactSettings -> Options -> FilePath -> String -> SimpPos -> IO [FilePath]
- compAddOneParameter :: FilePath -> String -> SimpPos -> RefactGhc [ApplyRefacResult]
- rmOneParameter :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath]
- compRmOneParameter :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult]
- roundTrip :: RefactSettings -> Options -> FilePath -> IO [FilePath]
Data Structures
data RefactSettings Source
RefSet | |
|
Re-exported from ghc-mod
data Options :: *
Options | |
|
Refactorings
ifToCase :: RefactSettings -> Options -> FilePath -> SimpPos -> SimpPos -> IO [FilePath] Source
Convert an if expression to a case expression
compIfToCase :: FilePath -> SimpPos -> SimpPos -> RefactGhc [ApplyRefacResult] Source
duplicateDef :: RefactSettings -> Options -> FilePath -> String -> SimpPos -> IO [FilePath] Source
This refactoring duplicates a definition (function binding or simple pattern binding) at the same level with a new name provided by the user. The new name should not cause name clash/capture.
compDuplicateDef :: FilePath -> String -> SimpPos -> RefactGhc [ApplyRefacResult] Source
liftToTopLevel :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath] Source
Lift a definition to the top level
compLiftToTopLevel :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult] Source
liftOneLevel :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath] Source
Move a definition one level up from where it is now
compLiftOneLevel :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult] Source
demote :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath] Source
Move a definition one level down
compDemote :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult] Source
rename :: RefactSettings -> Options -> FilePath -> String -> SimpPos -> IO [FilePath] Source
Rename the given identifier.
compRename :: FilePath -> String -> SimpPos -> RefactGhc [ApplyRefacResult] Source
Body of the refactoring
addOneParameter :: RefactSettings -> Options -> FilePath -> String -> SimpPos -> IO [FilePath] Source
compAddOneParameter :: FilePath -> String -> SimpPos -> RefactGhc [ApplyRefacResult] Source
rmOneParameter :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath] Source
The refactoring removes a user specified formal parameter in a function
binding,and the corresponding actual parameters in all calling places of this
function. The condition acompanying this refactoring is that the parameter to
be removed is not being used.
The SimpPos
should be somwewhere inside the parameter to be removed
compRmOneParameter :: FilePath -> SimpPos -> RefactGhc [ApplyRefacResult] Source