apply-refact: Perform refactorings specified by the refact library.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

One of either the input file or --refact-file must be specified on the command
line. If an input file is specified but not --refact-file then refactor will
accept refactorings from stdin and vice versa.

The -i option can be specified to perform the refactoring inplace overwriting
the input file. This option is ignored when input is read from stdin.

The -s option can be specified to perform a stepwise evaluation of the refact
file. The user is prompted whether to perform each hint before it is performed.

The --pos option is intended to be used by tooling in order to specify which
specific hint should be performed.

Refact Files

Refact files should be the result of show on a value of type [(String,
[Refactoring SrcSpan])]. The string is a description of the refactoring, one
description can have many associated refactoring steps.

Library Structure

The executable is provide so that libraries can use apply-refact without depending on the package.
The implementation relies on ghc-exactprint which depends itself on GHC. A
transitive dependancy that most developers wish to avoid!

Reporting Bugs

If the program produces a syntactically incorrect result then this is a bug.
Please open an issue on the issue tracker with precise instructions about how to
reproduce it.

The input file

The refact file

The command used to invoke refactor

There are some known problems with CPP processing. If your library contains CPP
directives other than #ifdef it is quite likely that the result will be
unexpected.

Debugging

There are also two hidden flags which can be useful for debugging.

--debug

Outputs the GHC AST.

--roundtrip

Performs no refactoring operations on the file but is useful to test whether
unexpected formatting is due to ghc-exactprint or the refactoring.