I can do this:
let foo = bar
|> baz
but I get a syntax error when I do this:
let foo = bar
<| baz
why?
I also get the syntax error when ever I define my own infix operators and try to use them in this manner.
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.
Unless I’m missing something, the two operators (as well as any other infix operator) behave the same. When I define
barandbazand use your example, I get an error in both of the cases. The off-side rule in F# allows you to indent the operator less far from the left, but the column of the arguments has to match:Both of these give an error message:
(Although you may see only the first error, because the F# compiler stops reporting additional errors after syntax error – probably because it cannot guarantee that they will be sensible)
The rules are quite well described in Code Formatting Guidelines on MSDN.