Interestingly operator precedence as defined for symbolic methods doesn't seem to hold for symbolic type aliases. Instead infix type aliases are always evaluated left associative:
type -[A,B] = Map[A,B]
type /[A,B] = Map[A,B] // '/' has higher precedence than '-' as an operator
classOf[A - B / C] // Class[/[-[A,B],C]]
classOf[A / B - C] // Class[-[/[A,B],C]]
Unfortunately that means it will never be possible to do what you ask for without parentheses like this:
classOf[A - (B / C)] // Class[-[A,/[B,C]]
So the closest answer is the following:
type ~>[A,B] = Map[A,B]
type ~~~>[A,B] = Pair[A,B]
classOf[A ~> (B ~~~> C)] // Map[A,Pair[B,C]]
Ommitting the parentheses will only be possible if you use right associative aliases (ending with :
)
type ~:[A,B] = Map[A,B]
type ~~~:[A,B] = Pair[A,B]
classOf[A ~: B ~~~: C] // Map[A,Pair[B,C]]
Again, unfortunately since all type aliases have the same precedence it is not possible to mix right and left associative aliases without parentheses.
Concerning the second part of your question: (A,B,C)
is syntactic sugar for Tuple3[A,B,C]
which is a type with three parameters. As infix types only take two parameters, I'm afraid that I believe there is no way to represent this type solely with infix types. You would always end up with nested two parameter types (e.g. (A,(B,C))
or ((A,B),C)
.