HaRe-0.7.2.8: the Haskell Refactorer.

Safe HaskellNone

Language.Haskell.Refact.HaRe

Contents

Synopsis

Data Structures

data RefactSettings Source

Constructors

RefSet 

Fields

rsetGhcOpts :: ![String]
 
rsetImportPaths :: ![FilePath]
 
rsetExpandSplice :: Bool
 
rsetLineSeparator :: LineSeparator
 
rsetMainFile :: Maybe [FilePath]
 
rsetCheckTokenUtilsInvariant :: !Bool
 
rsetVerboseLevel :: !VerboseLevel
 
rsetEnabledTargets :: (Bool, Bool, Bool, Bool)
 

Instances

data VerboseLevel Source

Constructors

Debug 
Normal 
Off 

Instances

type SimpPos = (Int, Int)

Refactorings

Note: the Cradle in the type signatures is the one from ghc-mod

ifToCase :: RefactSettings -> Cradle -> FilePath -> SimpPos -> SimpPos -> IO [FilePath]Source

Convert an if expression to a case expression

duplicateDef :: RefactSettings -> Cradle -> 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 -> Cradle -> FilePath -> SimpPos -> IO [FilePath]Source

Lift a definition to the top level

liftOneLevel :: RefactSettings -> Cradle -> FilePath -> SimpPos -> IO [FilePath]Source

Move a definition one level up from where it is now

demote :: RefactSettings -> Cradle -> FilePath -> SimpPos -> IO [FilePath]Source

Move a definition one level down

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

Rename the given identifier.

swapArgs :: RefactSettings -> Cradle -> [String] -> IO [FilePath]Source