headOption

trait Collection[A] {
  def headOption: Option[A]
}

headOption returns the first element of this collection, wrapped with Some.

On empty collections when there is no first element this function returns None.