More liberal way of aligning matches#83
Open
alexgerdes wants to merge 5 commits intoennocramer:masterfrom
Open
More liberal way of aligning matches#83alexgerdes wants to merge 5 commits intoennocramer:masterfrom
alexgerdes wants to merge 5 commits intoennocramer:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current implementation is quite restrictive in aligning matches. For example, if one function binding has a where-clause, aligning is abandoned. The same goes for if a function binding has a guarded right hand side. This commit allows for a more liberal way of aligning matches; something that I find myself doing all the time.
Consider the following snippet:
It will get formated as follows:
This way of aligning is nicely controlled by the limits, e.g., setting the limit to 6 will not align the equal signs in this particular example.