I read a book that uses infix, infixr, and infixl in the sample programs. I'm wondering what the differences are. I'm guessing that infixr performs operation from right to left, and vice versa.
+1
A:
Yes, the r/l indicates the associativity. Without testing I'd assume that infix
has normal left associativity.
Svend
2010-04-11 16:08:49
A:
infix
defines the operator to be left-associative, infixr
defines it to be right-associative. infixl
does not exist.
sepp2k
2010-04-11 16:15:16
A:
It depends on the implementation. The SML '97 standard is a little different from SML/NJ and Mlton. You get slightly different behaviour with each in terms of associativity rules and the way expressions are parenthesised depending on priority (the standard is a bit stricter than the implementations).
Nicholas Wilson
2010-04-20 10:19:04