Multiplication is associative. This means that (x * y) * z
is the same as x * (y * z)
. However, :
is not associative.
However, the terms "left-associative" and "right-associative" are different, and unrelated to the term "associative".
If
*
is left-associative, thenx * y * z
is the same thing as(x * y) * z
. The parentheses are redundant.If
*
is right-associative, thenx * y * z
is the same thing asx * (y * z)
. The parentheses are redundant.
Currying has nothing to do with this.
Since :
is right-associative, [3,4,5,6]
can be written as:
3:(4:(5:(6:[])))
3:4:(5:(6:[]))
3:(4:5:(6:[]))
3:4:5:(6:[])
3:(4:(5:6:[]))
3:4:(5:6:[])
3:(4:5:6:[])
3:4:5:6:[]