intellij-arend icon indicating copy to clipboard operation
intellij-arend copied to clipboard

Warn about partially applied infix operators in prefix form

Open marat-rkh opened this issue 3 years ago • 2 comments

https://arend-lang.github.io/documentation/language-reference/definitions/#infix-operators

According to this section of the documentation, the following 2 usages of + are equivalent:

\func f => map (3 +) []
\func g => map (+ 3) []

However, it might be surprising that the second usage is not a right section. I am not sure if there are cases when the second usage is preferable to the first one. But if these cases are rare and discouraged, we might have an inspection that detects such cases and either suggests replacing (+ 3) with a "more preferable" equivalent (3 +), or with a proper right section (`+ 3).

marat-rkh avatar Sep 13 '21 18:09 marat-rkh

Did you mean to open an issue in the Arend repo? 🤣

ice1000 avatar Sep 13 '21 19:09 ice1000

No, I would implement it as an inspection with quick fixes in the plugin)

marat-rkh avatar Sep 14 '21 06:09 marat-rkh