RefactoringTools / HaRe

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

Big Pull Request #48

Closed SAdams601 closed 7 years ago

SAdams601 commented 7 years ago

This pull request includes two new refactorings and multiple other library changes.

The new refactorings are, delete a definition and generalise monad to applicative.

Delete a definition will remove some top level definition from a file.

Generalise monad to applicative will rewrite a do block using the applicative operators. For more information about how that works see the following pdf of a paper currently in review for publication in IFL 2016.

ifl2016.pdf

I have added three new utility modules Language.Haskell.Refact.Utils(Synonyms, Transform, and Query).

Synonyms simply exports type synonyms of certain parsed GHC AST types.

Query is a module that contains functions that retrieve parts of the AST and check preconditions on AST chunks.

Transform is a module of fairly high level rewriting functions. It's common to want to do things like wrap an AST chunk in parenthesis and Transform has a function that handles both the AST and annotation changes required to do this.

I have also added several other functions to existing utility modules.

alanz commented 7 years ago

Once travis gives it green I will merge.

And then I think it will be time for a release. Awesome.

SAdams601 commented 7 years ago

I've pushed fixing everything except for the issue with merging anns. I'm going to have to take a closer look and see how I want to rewrite everything.

alanz commented 7 years ago

Ok. This is more a journey than something absolute.