I'm reading a tutorial for demonstration about lifting method in Scala. Here is the code for basic class:
case object None extends Optional[Nothing]
case class Presenter[+A](get: A) extends Optional[A]
trait Optional[+A] {
def map[B](f: A => B): Optional[B] = this match {
case None => None
case Presenter(x) => Presenter(f(x))
}
}
Here is the lift method:
def lift[A, B](f: A => B): Optional[A] => Optional[B] = _ map f
My question is: what does underscore ("_") represent in above function.
thanks