Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify extracts after running tactics #1351

Merged
merged 16 commits into from
Feb 12, 2021
Merged

Conversation

isovector
Copy link
Collaborator

@isovector isovector commented Feb 12, 2021

This PR adds a small simplification step after running tactics, which attempts to perform some common Haskell idioms. It will eta reduce expressions, so no more stupid implementations like fmap (\a -> f a) x. It also composes functions, so \x -> f (g x) becomes f . g instead.

The goal is not to be perfect and replace hlint, merely just to get the easy cases.

I'd like to put some real tests on these simplifier functions, but it's not clear to me how to do so. If anyone has any ideas, please let me know!

@TOTBWF please review.

@isovector isovector changed the title [wip] Simplify extracts after running tactics Simplify extracts after running tactics Feb 12, 2021
@isovector isovector marked this pull request as ready for review February 12, 2021 01:53
Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, based on the new test cases (i am afraid i dont know the tactic plugin code base very well)

@isovector
Copy link
Collaborator Author

@jneira thanks for the bits! I have a preference for tagging you due to how promptly you respond to PRs, but please let me know if it's over too often!

@isovector
Copy link
Collaborator Author

@TOTBWF mind doing a review of this as well?

@jneira
Copy link
Member

jneira commented Feb 12, 2021

no problem, but i am afraid that i cant do reviews in deep 😟

Copy link
Contributor

@TOTBWF TOTBWF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@isovector isovector added the merge me Label to trigger pull request merge label Feb 12, 2021
@mergify mergify bot merged commit dcd8299 into haskell:master Feb 12, 2021
@isovector isovector deleted the simplify branch May 21, 2021 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants