HaRe-0.8.2.2: 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

optOutput :: OutputOpts
 
optPrograms :: Programs
 
optGhcUserOptions :: [GHCOption]

GHC command line options set on the ghc-mod command line

optOperators :: Bool

If True, browse also returns operators.

optDetailed :: Bool

If True, browse also returns types.

optQualified :: Bool

If True, browse will return fully qualified name

optHlintOpts :: [String]
 
optFileMappings :: [(FilePath, Maybe FilePath)]
 

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.

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

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