-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Fix: #1690 - Infix typed holes are now filled using infix notation #1708
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix, tests cases looks great, many thanks!
The unique caveat i can think of is somebody is using already postfix notation and we turn it in infix one, is there some test case to check we will not do it? |
Do you mean that we should check that infix form is not used when prefix is required? So we should make sure foo :: Int -> Int -> Int
foo = _ a1 a2 is filled to foo :: Int -> Int -> Int
foo a1 a2 = (+) a1 a2 ? I've added this as a test case. |
yeah, that was my idea, many thanks |
fix: #1690
In follow up to my response to @July541's PR (#1694), I have written a different solution to cover the cases of filling holes with infix operators.
applying the "replace _ with (+)" code action to
now results in
rather than
Note: This solution depends on
processHoleSuggestions
returning infix functions in their prefix form (e.g.(+)
) to determine if a function infix/prefix. I imagine there might be a nicer way of doing this.Edit: In some commit messages I have written "postfix" by mistake instead of "prefix"