Daml Linter preference - Infix versus Prefix
- meetOP 1
Suggestion: Use infix Found: notElem p (signatory this) Perhaps: p `notElem` signatory thisWhy is using infix considered better quality code than using prefix as per the Daml linter?
- Luciano
My guess is that the infix version gets rid of the parentheses. I think that’s the rule which is triggering the linter.
- cocreature
It’s not primarily about parentheses and it’s not triggered because of that, it’s a custom rule.
The usual argument for using the infix version is that in that case, the argument order corresponds to how you would phrase things in English “x is not an element of y”. In the prefix version it is less clear what the first and second argument’s role is.
That said, I think we dropped a similar rule for
elem, and if there’s something resembling consensus I have no issues dropping this one. - meet
Yep, my example just happened to contain a parenthesis - get the same with
notElem 1 [2,3]
To me, it makes sense to apply the same linting rule fornotElemas we did forelemThanks @cocreature !
- bernhard
I for one prefer infix to prefix for mathematical operations because it matches how I would read and parse statements on paper. I think of
elemandnotElemas ∈ and ∉. - georg 1
Agree it reads better, but I just hate the `backticks`

- meet
@georg same

- Luciano
bernhard:∈ and ∉
Should we add these as unicode operators?
? Pretty sure this was restricted … - georg 1
Oooh yes! And then alias
for fmapand
for fromSome=>