My interpretation of _._1 is:
_ = wildcard parameter
_1 = first parameter in method parameter list
But when used together with . what does it signify?
This is how its used :
.toList.sortWith(_._1 < _._1)
For this statement:
_++_
I’m lost. Is it concatenation two wildcard parameters somehow?
This is how its used:
.reduce(_++_)
I would be particularly interested if they above code could be made more verbose and remove any implicits, just so I can understand it better?
_._1calls the method_1on the wildcard parameter_, which gets the first element of a tuple. Thus,sortWith(_._1 < _._1)sorts the list of tuple by their first element._++_calls the method++on the first wildcard parameter with the second parameter as an argument.++does concatenation for sequences. Thus.reduce(_++_)concatenates a list of sequences together. Usually you can useflattenfor that.