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

Fix: Infix holes no longer filled using prefix notation #1696

Closed
wants to merge 5 commits into from
Closed

Fix: Infix holes no longer filled using prefix notation #1696

wants to merge 5 commits into from

Conversation

OliverMadine
Copy link
Collaborator

@OliverMadine OliverMadine commented Apr 8, 2021

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

test :: Int -> Int -> Int
test a1 a2 = a1 `_` a2

now results in

test :: Int -> Int -> Int
test a1 a2 = a1 + a2

rather than

test :: Int -> Int -> Int
test a1 a2 = a1 `(+)` a2

Note: This solution depends on processHoleSuggestions returning infix functions in their postfix form (e.g. (+)) to determine if a function infix/postfix. I imagine there might be a nicer way of doing this.

@OliverMadine OliverMadine changed the title Fix: Infix holes no longer filled with postfix notation Fix: Infix holes no longer filled using postfix notation Apr 8, 2021
@isovector
Copy link
Collaborator

isovector commented Apr 8, 2021

Sorry, merged master into the wrong PR! My bad!

@OliverMadine
Copy link
Collaborator Author

OliverMadine commented Apr 11, 2021

Closed due to GitHub issues (committed to branch master by mistake). I will reopen shortly (#1708)

@OliverMadine OliverMadine changed the title Fix: Infix holes no longer filled using postfix notation Fix: Infix holes no longer filled using prefix notation Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infix backticked holes get their backticks deleted once filled
2 participants