I work on Runar and Paul functional programming examples in the Scala book, and I came across the following implementation of the lift function in section 4.3.2:
def lift[A,B](f: A => B): Option[A] => Option[B] = _ map f
I understand the purpose of the function, but I do not understand the implementation, because I do not understand what the underscore is. I looked at many other threads about the myriad underscore values ββin Scala, and although I'm sure these threads should mention this type of use case, I must have missed it.
source share