<div dir="ltr"><div><div><div>Hi Andrew<br><br></div>Thanks for the offer, that will be awesome.<br><br></div>In emacs the process is to highlight in a buffer the point where a change should happen, for example place the cursor on something that needs renaming, and then press the key binding for the relevant refactoring. The elisp uses the name of the buffer, location of the cursor and/or current highlighted region to construct the parameters for a call to ghc-hare.<br><br></div><div>When it is done, ghc-hare returns either (ok [files]) to indicate success and the names of the files that were changed, or (error "description of error").<br><br></div><div>HaRe does not actually change any files, it just places a new version next to to it with an extension of .refactored.hs. In emacs a (optional) series of ediff buffers are presented to review the changes. If the user accepts them the elisp copies the original files to the same name but with a date-time string as a suffix, and renames the refactored file to be the original. It should then reload the buffer, but I think that is missing right now.<br><br></div><div>Alan<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 5, 2015 at 8:07 AM, Andrew Gibiansky <span dir="ltr"><<a href="mailto:andrew.gibiansky@gmail.com" target="_blank">andrew.gibiansky@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Alan,<div><br></div><div>This is awesome. I can't express how excited I am to see this develop further.</div><div><br></div><div>I'll gladly start working on Vim support.</div><div><br></div><div>Could you describe how it works with emacs?</div><div><br></div><div>-- Andrew</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sun, Oct 4, 2015 at 1:18 PM, Alan & Kim Zimmerman <span dir="ltr"><<a href="mailto:alan.zimm@gmail.com" target="_blank">alan.zimm@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>I'm pleased to announce the release of HaRe 0.8, available on hackage [1]<br><br>What's new?<br>===========<br><br>Everything, and nothing.<br><br>Everything in the sense that it has been completely reworked internally to make<br>use of the new API Annotations [2] in GHC 7.10.2, via the ghc-exactprint [3]<br>library.<br><br>Nothing in the sense that the functionality in this version is/should be<br>identical to that in 0.7.2.8<br><br>Limitations<br>===========<br><br>HaRe 0.8 will only work for projects using GHC 7.10.2 for compilation. Compiling<br>HaRe with 7.10.2 and then using it against projects using an earlier compiler<br>will not work, as HaRe needs to be able to invoke GHC to the type checker stage<br>on the project using GHC 7.10.2.<br><br>What is it?<br>===========<br><br>HaRe makes changes to working code, so that it still works once the change is<br>made.<br><br>Refactorings it can do are<br><br>* demote<br><br>  Take a declaration from the level where it is defined and move it down to the<br>  place where it is used. This only works if it is used in one place only.<br><br>* dupdef<br><br>  Duplicate a definition with a new name.<br><br>* iftocase<br><br>  Convert an if declaration to a case declaration.<br><br>* liftOneLevel<br><br>  Move a declaration one level up, adding parameters as needed to pass in<br>  locally declared variables.<br><br>* liftToTopLevel<br><br>  Move a declaration to the top level, adding parameters as needed to pass in<br>  locally declared variables.<br><br>* rename<br><br>  Change a name throughout the project. This makes use of the GHC renamed source<br>  so will not change other names that just happen to be lexically identical, but<br>  are in fact different names.<br><br>It currently has an emacs integration only, assistance in supporting other<br>environnments welcome.<br><br>[1] <a href="https://hackage.haskell.org/package/HaRe" target="_blank">https://hackage.haskell.org/package/HaRe</a><br>[2] <a href="https://ghc.haskell.org/trac/ghc/wiki/ApiAnnotations" target="_blank">https://ghc.haskell.org/trac/ghc/wiki/ApiAnnotations</a><br>[3] <a href="https://hackage.haskell.org/package/ghc-exactprint" target="_blank">https://hackage.haskell.org/package/ghc-exactprint</a><span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Alan<br><div><br></div></font></span></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>