RefactoringTools / HaRe

The Haskell Refactoring Tool
http://www.cs.kent.ac.uk/projects/refactor-fp/
Other
139 stars 32 forks source link

Heavily clean up the ...Refactoring.Rename module #17

Closed glittershark closed 8 years ago

glittershark commented 8 years ago

Heavily clean up the code in the refactoring.rename module, by:


A further question: I find the use of error as a means to return errors from refactor operations a pretty heavy code smell. Would there be support for a wide-reaching refactor to change this to encode an error condition in the RefactGhc monad instead?

glittershark commented 8 years ago

More ideas: something I've seen done in some Haskell projects is to define binary ADTs for each option-switch or return value rather than use Booleans everywhere, as that serves to both self-document function calls and avoid mucking up argument error.

glittershark commented 8 years ago

Oh, also, there's some copyediting of the error messages here as well

alanz commented 8 years ago

I have been focusing on other stuff, so been ignoring this for a while, sorry.

In general I regard the current (long) phase of HaRe development as a port of the pre-GHC code to GHC. As such, I prefer to keep things as close to the original as possible until this is done, and this relates to silly things like returning via error.

That said, the Renaming is so different anyway that I am happy to merge this patch.