We have the generic HOF mapper which transforms every A element to another R element using the transformation lambda as a function parameter:
def mapper[A, B](list: List[A], transformation: A => B): List[B]
Implement the toLengths function using mapper and your lambda to return the length of the names.