Which of theese two alternatives do you find yourself using most often, and which is more ‘idiomatic’?
- f arg (obj.DoStuff())
- f arg <| obj.DoStuff()
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Overall, I don’t know that one or the other is more idiomatic.
Personally, the only time I use <| is with ‘raise’:
Apart from that, I always use parens. Note that since most F# code uses curried functions, this does not typically imply any ‘extra’ parens:
It’s when you get into non-curried functions and constructors and whatnot that it starts getting less pretty:
We will probably at least consider changing the F# languages rules so that high-precedence applications bind even more tightly; right now
parses like
but a lot of people would like it to parse as
(the motivating case in the original question). If you have a strong opinion about this, leave a comment on this response.