Closed glittershark closed 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.
Oh, also, there's some copyediting of the error messages here as well
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.
Heavily clean up the code in the refactoring.rename module, by:
when
over heavily nested ifs wherever possiblemaybe
over case statements in one place||
over heavily nested ifs in a couple placesA 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 theRefactGhc
monad instead?