HaRe-0.8.4.0: the Haskell Refactorer.

Safe HaskellNone
LanguageHaskell98

Language.Haskell.Refact.HaRe

Contents

Synopsis

Data Structures

type SimpPos = (Int, Int) Source #

Re-exported from ghc-mod

data Options :: * #

Constructors

Options 

Fields

Instances

Refactorings

ifToCase :: RefactSettings -> Options -> FilePath -> SimpPos -> SimpPos -> IO [FilePath] Source #

Convert an if expression to a case expression

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.

liftToTopLevel :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath] Source #

Lift a definition to the top level

liftOneLevel :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath] Source #

Move a definition one level up from where it is now

demote :: RefactSettings -> Options -> FilePath -> SimpPos -> IO [FilePath] Source #

Move a definition one level down

rename :: RefactSettings -> Options -> FilePath -> String -> SimpPos -> IO [FilePath] Source #

Rename the given identifier.

compRename :: FilePath -> String -> SimpPos -> RefactGhc [ApplyRefacResult] Source #

Body of the refactoring

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

roundTrip :: RefactSettings -> Options -> FilePath -> IO [FilePath] Source #

Roundtrip the source code, to check that the infrastructure is solid