I\'ve just started playing around with Scala, and I just learned about how methods can be made right-associative (as opposed to the more traditional left-associ
Right-associativity and Left-associativity plays an important role when you are performing List fold operations. For eg:
def concat[T](xs: List[T], ys: List[T]): List[T] = (xs foldRight ys)(_::_)
This works perfectly fine. But you cannot perform the same using foldLeft operation
def concat[T](xs: List[T], ys: List[T]): List[T] = (xs foldLeft ys)(_::_)
,because :: is right-associative.