4 ms·
re: Your edit: Basically. Lift the method to a function first. def plus(a: Int, b: Int): Int = a + b List( (1,2), (3,4) ) map(plus _ tupled) > List(3, 7
by ssmoot 12y ago
re: Your edit: Basically. Lift the method to a function first.
def plus(a: Int, b: Int): Int = a + b
List( (1,2), (3,4) ) map(plus _ tupled)
> List(3, 7)
( I know there's already 4 or 5 answers... I just think mine's the prettiest. ;-) )